aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-04-15 00:06:07 +0000
committerDevang Patel <dpatel@apple.com>2009-04-15 00:06:07 +0000
commitaf5b6bb6a539f1d4cc3b0f0e10b3c3c9267bbfd1 (patch)
treedd8b2fd078e706c87ab36662db5a5664a2cf27a0 /lib/Analysis/DebugInfo.cpp
parent6d9305c7fd3cd5ecf6e6326da0b8ed1f63a771f3 (diff)
Add a method to check that the subprogram holds debug info for the given Function or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r--lib/Analysis/DebugInfo.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 5a8e5cb90b..7db9b2f3bc 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -291,6 +291,19 @@ uint64_t DIDerivedType::getOriginalTypeSize() const {
return BT.getSizeInBits();
}
+/// describes - Return true if this subprogram provides debugging
+/// information for the function F.
+bool DISubprogram::describes(const Function *F) {
+ assert (F && "Invalid function");
+ std::string Name;
+ getLinkageName(Name);
+ if (Name.empty())
+ getName(Name);
+ if (!Name.empty() && (strcmp(Name.c_str(), F->getNameStart()) == false))
+ return true;
+ return false;
+}
+
//===----------------------------------------------------------------------===//
// DIFactory: Basic Helpers
//===----------------------------------------------------------------------===//