[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineDebugInfo.h

Jim Laskey jlaskey at apple.com
Thu Feb 23 14:37:43 PST 2006



Changes in directory llvm/include/llvm/CodeGen:

MachineDebugInfo.h updated: 1.18 -> 1.19
---
Log message:

Added basic support for typedefs.


---
Diffs of the changes:  (+39 -2)

 MachineDebugInfo.h |   41 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 39 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/CodeGen/MachineDebugInfo.h
diff -u llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.18 llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.19
--- llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.18	Thu Feb 23 10:58:18 2006
+++ llvm/include/llvm/CodeGen/MachineDebugInfo.h	Thu Feb 23 16:37:30 2006
@@ -62,7 +62,8 @@
   DI_TAG_compile_unit,
   DI_TAG_global_variable,
   DI_TAG_subprogram,
-  DI_TAG_basictype
+  DI_TAG_basictype,
+  DI_TAG_typedef
 };
 
 //===----------------------------------------------------------------------===//
@@ -342,6 +343,42 @@
 #endif
 };
 
+
+//===----------------------------------------------------------------------===//
+/// TypedefDesc - This class packages debug information associated with a
+/// derived typedef.
+class TypedefDesc : public TypeDesc {
+private:
+  TypeDesc *FromType;                   // Type derived from.
+  CompileUnitDesc *File;                // Declared compile unit.
+  int Line;                             // Declared line#.
+
+public:
+  TypedefDesc();
+  
+  // Accessors
+  TypeDesc *getFromType()                    const { return FromType; }
+  CompileUnitDesc *getFile()                 const { return File; }
+  int getLine()                              const { return Line; }
+  void setFromType(TypeDesc *F)                    { FromType = F; }
+  void setFile(CompileUnitDesc *U)                 { File = U; }
+  void setLine(int L)                              { Line = L; }
+
+  // Implement isa/cast/dyncast.
+  static bool classof(const TypedefDesc *)  { return true; }
+  static bool classof(const DebugInfoDesc *D) {
+    return D->getTag() == DI_TAG_typedef;
+  }
+  
+  /// ApplyToFields - Target the visitor to the fields of the  TypedefDesc.
+  ///
+  virtual void ApplyToFields(DIVisitor *Visitor);
+
+#ifndef NDEBUG
+  virtual void dump();
+#endif
+};
+
 //===----------------------------------------------------------------------===//
 /// GlobalDesc - This class is the base descriptor for global functions and
 /// variables.
@@ -712,7 +749,7 @@
                              getGlobalVariablesUsing(M, Desc.getAnchorString());
     std::vector<T *> AnchoredDescs;
     for (unsigned i = 0, N = Globals.size(); i < N; ++i) {
-      AnchoredDescs.push_back(static_cast<T *>(DR.Deserialize(Globals[i])));
+      AnchoredDescs.push_back(cast<T>(DR.Deserialize(Globals[i])));
     }
 
     return AnchoredDescs;






More information about the llvm-commits mailing list