DebugInfo: provide the ability to add members to a class after it has been constructed
[oota-llvm.git] / include / llvm / DebugInfo.h
index 689b3ddfd1ffe400889544be94935de602882f7b..b02446abbbfdd0e4957b6a785f8d07a924664bbb 100644 (file)
@@ -110,7 +110,7 @@ namespace llvm {
       return !operator==(Other);
     }
 
-    unsigned getTag() const {
+    uint16_t getTag() const {
       return getUnsignedField(0) & ~LLVMDebugVersionMask;
     }
 
@@ -129,7 +129,6 @@ namespace llvm {
     bool isSubrange() const;
     bool isEnumerator() const;
     bool isType() const;
-    bool isGlobal() const;
     bool isUnspecifiedParameter() const;
     bool isTemplateTypeParameter() const;
     bool isTemplateValueParameter() const;
@@ -188,6 +187,9 @@ namespace llvm {
   public:
     explicit DIScope(const MDNode *N = 0) : DIDescriptor (N) {}
 
+    /// Gets the parent scope for this scope node or returns a
+    /// default constructed scope.
+    DIScope getContext() const;
     StringRef getFilename() const;
     StringRef getDirectory() const;
   };
@@ -321,6 +323,7 @@ namespace llvm {
 
     DIArray getTypeArray() const { return getFieldAs<DIArray>(10); }
     void setTypeArray(DIArray Elements, DIArray TParams = DIArray());
+    void addMember(DISubprogram S);
     unsigned getRunTimeLang() const { return getUnsignedField(11); }
     DICompositeType getContainingType() const {
       return getFieldAs<DICompositeType>(12);
@@ -715,10 +718,12 @@ namespace llvm {
   /// cleanseInlinedVariable - Remove inlined scope from the variable.
   DIVariable cleanseInlinedVariable(MDNode *DV, LLVMContext &VMContext);
 
-  /// DebugInfoFinder tries to list all debug info MDNodes in a module. To
+  /// DebugInfoFinder tries to list all debug info MDNodes used in a module. To
   /// list debug info MDNodes used by an instruction, DebugInfoFinder uses
-  /// processDeclare and processValue. processModule will go through
-  /// all DICompileUnits and list debug info MDNodes used by the CUs.
+  /// processDeclare, processValue and processLocation to handle DbgDeclareInst,
+  /// DbgValueInst and DbgLoc attached to instructions. processModule will go
+  /// through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
+  /// used by the CUs.
   class DebugInfoFinder {
   public:
     /// processModule - Process entire module and collect debug info
@@ -729,6 +734,8 @@ namespace llvm {
     void processDeclare(const DbgDeclareInst *DDI);
     /// Process DbgValueInst.
     void processValue(const DbgValueInst *DVI);
+    /// processLocation - Process DILocation.
+    void processLocation(DILocation Loc);
 
     /// Clear all lists.
     void reset();
@@ -742,9 +749,6 @@ namespace llvm {
     /// processSubprogram - Process DISubprogram.
     void processSubprogram(DISubprogram SP);
 
-    /// processLocation - Process DILocation.
-    void processLocation(DILocation Loc);
-
     void processScope(DIScope Scope);
 
     /// addCompileUnit - Add compile unit into CUs.