-//===----------------------------------------------------------------------===//
-// Simple Descriptor Constructors and other Methods
-//===----------------------------------------------------------------------===//
-
-DIScopeRef DIScope::getRef() const { return MDScopeRef::get(get()); }
-
-void DICompileUnit::replaceSubprograms(DIArray Subprograms) {
- get()->replaceSubprograms(MDSubprogramArray(Subprograms));
-}
-
-void DICompileUnit::replaceGlobalVariables(DIArray GlobalVariables) {
- get()->replaceGlobalVariables(MDGlobalVariableArray(GlobalVariables));
-}
-
-DIVariable llvm::createInlinedVariable(MDNode *DV, MDNode *InlinedScope,
- LLVMContext &VMContext) {
- return cast<MDLocalVariable>(DV)
- ->withInline(cast_or_null<MDLocation>(InlinedScope));
-}
-
-DIVariable llvm::cleanseInlinedVariable(MDNode *DV, LLVMContext &VMContext) {
- return cast<MDLocalVariable>(DV)->withoutInline();
-}
-
-DISubprogram llvm::getDISubprogram(const MDNode *Scope) {
- if (auto *LocalScope = dyn_cast_or_null<MDLocalScope>(Scope))
+DISubprogram *llvm::getDISubprogram(const MDNode *Scope) {
+ if (auto *LocalScope = dyn_cast_or_null<DILocalScope>(Scope))