diff options
author | Devang Patel <dpatel@apple.com> | 2009-08-31 20:44:45 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-08-31 20:44:45 +0000 |
commit | d9b6115f272d63e458d91b7d040c95783b41412b (patch) | |
tree | 635f7c7698759314a595be6759e95cc46ccb4654 /llvm/lib/Analysis/DebugInfo.cpp | |
parent | 88a26fb0f1e226d381cd9cce058c807ee989675c (diff) | |
download | bcm5719-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.cpp | 16 |
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 |