[llvm-commits] [llvm] r62602 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h include/llvm/CodeGen/MachineModuleInfo.h include/llvm/Support/Dwarf.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Devang Patel dpatel at apple.com
Tue Jan 20 11:22:03 PST 2009


Author: dpatel
Date: Tue Jan 20 13:22:03 2009
New Revision: 62602

URL: http://llvm.org/viewvc/llvm-project?rev=62602&view=rev
Log:
Need only one set of debug info versions enum.

Modified:
    llvm/trunk/include/llvm/Analysis/DebugInfo.h
    llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h
    llvm/trunk/include/llvm/Support/Dwarf.h
    llvm/trunk/lib/Analysis/DebugInfo.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=62602&r1=62601&r2=62602&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Jan 20 13:22:03 2009
@@ -32,15 +32,6 @@
   class Instruction;
 
   class DIDescriptor {
-  public:
-    enum {
-      Version7    = 7 << 16,     // Current version of debug information.
-      Version6    = 6 << 16,     // Constant for version 6.
-      Version5    = 5 << 16,     // Constant for version 5.
-      Version4    = 4 << 16,     // Constant for version 4.
-      VersionMask = 0xffff0000   // Mask for version number.
-    };
-
   protected:    
     GlobalVariable *GV;
 
@@ -72,11 +63,11 @@
     GlobalVariable *getGV() const { return GV; }
 
     unsigned getVersion() const {
-      return getUnsignedField(0) & VersionMask;
+      return getUnsignedField(0) & LLVMDebugVersionMask;
     }
 
     unsigned getTag() const {
-      return getUnsignedField(0) & ~VersionMask;
+      return getUnsignedField(0) & ~LLVMDebugVersionMask;
     }
 
   };

Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=62602&r1=62601&r2=62602&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Tue Jan 20 13:22:03 2009
@@ -55,17 +55,6 @@
 class StructType;
 
 //===----------------------------------------------------------------------===//
-// Debug info constants.
-
-enum {
-  LLVMDebugVersion = (7 << 16),         // Current version of debug information.
-  LLVMDebugVersion6 = (6 << 16),        // Constant for version 6.
-  LLVMDebugVersion5 = (5 << 16),        // Constant for version 5.
-  LLVMDebugVersion4 = (4 << 16),        // Constant for version 4.
-  LLVMDebugVersionMask = 0xffff0000     // Mask for version number.
-};
-
-//===----------------------------------------------------------------------===//
 /// SourceLineInfo - This class is used to record source line correspondence.
 ///
 class SourceLineInfo {

Modified: llvm/trunk/include/llvm/Support/Dwarf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Dwarf.h?rev=62602&r1=62601&r2=62602&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/Dwarf.h (original)
+++ llvm/trunk/include/llvm/Support/Dwarf.h Tue Jan 20 13:22:03 2009
@@ -18,6 +18,17 @@
 
 namespace llvm {
 
+//===----------------------------------------------------------------------===//
+// Debug info constants.
+
+enum {
+LLVMDebugVersion = (7 << 16),         // Current version of debug information.
+LLVMDebugVersion6 = (6 << 16),        // Constant for version 6.
+LLVMDebugVersion5 = (5 << 16),        // Constant for version 5.
+LLVMDebugVersion4 = (4 << 16),        // Constant for version 4.
+LLVMDebugVersionMask = 0xffff0000     // Mask for version number.
+};
+
 namespace dwarf {
 
 //===----------------------------------------------------------------------===//

Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=62602&r1=62601&r2=62602&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Jan 20 13:22:03 2009
@@ -291,9 +291,9 @@
 }
 
 Constant *DIFactory::GetTagConstant(unsigned TAG) {
-  assert((TAG & DIDescriptor::VersionMask) == 0 &&
+  assert((TAG & LLVMDebugVersionMask) == 0 &&
          "Tag too large for debug encoding!");
-  return ConstantInt::get(Type::Int32Ty, TAG | DIDescriptor::Version7);
+  return ConstantInt::get(Type::Int32Ty, TAG | LLVMDebugVersion);
 }
 
 Constant *DIFactory::GetStringConstant(const std::string &String) {

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62602&r1=62601&r2=62602&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 20 13:22:03 2009
@@ -1559,7 +1559,7 @@
   void AddSourceLine(DIE *Die, const DIVariable *V) {
     unsigned FileID = 0;
     unsigned Line = V->getLineNumber();
-    if (V->getVersion() < DIDescriptor::Version7) {
+    if (V->getVersion() <= LLVMDebugVersion6) {
       // Version6 or earlier. Use compile unit info to get file id.
       CompileUnit *Unit = FindCompileUnit(V->getCompileUnit());
       FileID = Unit->getID();
@@ -1578,7 +1578,7 @@
   void AddSourceLine(DIE *Die, const DIGlobal *G) {
     unsigned FileID = 0;
     unsigned Line = G->getLineNumber();
-    if (G->getVersion() < DIDescriptor::Version7) {
+    if (G->getVersion() < LLVMDebugVersion6) {
       // Version6 or earlier. Use compile unit info to get file id.
       CompileUnit *Unit = FindCompileUnit(G->getCompileUnit());
       FileID = Unit->getID();
@@ -1595,7 +1595,7 @@
   void AddSourceLine(DIE *Die, const DIType *Ty) {
     unsigned FileID = 0;
     unsigned Line = Ty->getLineNumber();
-    if (Ty->getVersion() < DIDescriptor::Version7) {
+    if (Ty->getVersion() <= LLVMDebugVersion6) {
       // Version6 or earlier. Use compile unit info to get file id.
       CompileUnit *Unit = FindCompileUnit(Ty->getCompileUnit());
       FileID = Unit->getID();
@@ -3046,7 +3046,7 @@
     DIDescriptor DI(GV);
     // Check current version. Allow Version6 for now.
     unsigned Version = DI.getVersion();
-    if (Version != DIDescriptor::Version7 && Version != DIDescriptor::Version6)
+    if (Version != LLVMDebugVersion && Version != LLVMDebugVersion6)
       return false;
 
     unsigned Tag = DI.getTag();





More information about the llvm-commits mailing list