Introduce DIScope.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80620 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index a67539c..e815931 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -210,6 +210,22 @@
   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