diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-13 19:07:27 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-13 19:07:27 +0000 |
| commit | 3c2d70434bd750683baa94432bfe9fd1f639f968 (patch) | |
| tree | af48b74f5b86aac27b510973e4d5c4a24fec2ecb /llvm/lib | |
| parent | 3ff56573294b531a123046c1ff7d4b91601261f1 (diff) | |
| download | bcm5719-llvm-3c2d70434bd750683baa94432bfe9fd1f639f968.tar.gz bcm5719-llvm-3c2d70434bd750683baa94432bfe9fd1f639f968.zip | |
DebugInfo: Migrate DISubprogram::describes() to new hierarchy, NFC
I don't really like this function at all -- I think it should be as
simple as `return getFunction() == F` -- but for now this seems like the
best we can do.
llvm-svn: 234778
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 12 | ||||
| -rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 10 |
2 files changed, 10 insertions, 12 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 7797a026211..d7f5f6396aa 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -49,18 +49,6 @@ bool DIVariable::isInlinedFnArgument(const Function *CurFn) { return !SP.describes(CurFn); } -bool DISubprogram::describes(const Function *F) { - assert(F && "Invalid function"); - if (F == getFunction()) - return true; - StringRef Name = getLinkageName(); - if (Name.empty()) - Name = getName(); - if (F->getName() == Name) - return true; - return false; -} - GlobalVariable *DIGlobalVariable::getGlobal() const { return dyn_cast_or_null<GlobalVariable>(getConstant()); } diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index 72126cc5fb2..ed6206264b0 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -348,6 +348,16 @@ Function *MDSubprogram::getFunction() const { return dyn_cast_or_null<Function>(getFunctionConstant()); } +bool MDSubprogram::describes(const Function *F) const { + assert(F && "Invalid function"); + if (F == getFunction()) + return true; + StringRef Name = getLinkageName(); + if (Name.empty()) + Name = getName(); + return F->getName() == Name; +} + void MDSubprogram::replaceFunction(Function *F) { replaceFunction(F ? ConstantAsMetadata::get(F) : static_cast<ConstantAsMetadata *>(nullptr)); |

