summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-08-31 20:44:45 +0000
committerDevang Patel <dpatel@apple.com>2009-08-31 20:44:45 +0000
commitd9b6115f272d63e458d91b7d040c95783b41412b (patch)
tree635f7c7698759314a595be6759e95cc46ccb4654 /llvm/lib/Analysis/DebugInfo.cpp
parent88a26fb0f1e226d381cd9cce058c807ee989675c (diff)
downloadbcm5719-llvm-d9b6115f272d63e458d91b7d040c95783b41412b.tar.gz
bcm5719-llvm-d9b6115f272d63e458d91b7d040c95783b41412b.zip
Introduce DIScope.
llvm-svn: 80620
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index a67539c1a07..e815931e611 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -210,6 +210,22 @@ bool DIDescriptor::isGlobalVariable() const {
return Tag == dwarf::DW_TAG_variable;
}
+/// isScope - Return true if the specified tag is one of the scope
+/// related tag.
+bool DIDescriptor::isScope() const {
+ assert (!isNull() && "Invalid descriptor!");
+ unsigned Tag = getTag();
+
+ switch (Tag) {
+ case dwarf::DW_TAG_compile_unit:
+ case dwarf::DW_TAG_lexical_block:
+ case dwarf::DW_TAG_subprogram:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
//===----------------------------------------------------------------------===//
// Simple Descriptor Constructors and other Methods
OpenPOWER on IntegriCloud