DebugInfo: Make MDSubprogram::getFunction() return Constant

Change `MDSubprogram::getFunction()` and
`MDGlobalVariable::getConstant()` to return a `Constant`.  Previously,
both returned `ConstantAsMetadata`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234699 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-11 20:27:40 +00:00
parent 3ec16b419f
commit e2e641234f
8 changed files with 61 additions and 60 deletions

View File

@@ -49,12 +49,6 @@ bool DIVariable::isInlinedFnArgument(const Function *CurFn) {
return !SP.describes(CurFn);
}
Function *DISubprogram::getFunction() const {
if (auto *C = dyn_cast_or_null<ConstantAsMetadata>(get()->getFunction()))
return dyn_cast<Function>(C->getValue());
return nullptr;
}
bool DISubprogram::describes(const Function *F) {
assert(F && "Invalid function");
if (F == getFunction())