Need only one set of debug info versions enum.
authorDevang Patel <dpatel@apple.com>
Tue, 20 Jan 2009 19:22:03 +0000 (19:22 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 20 Jan 2009 19:22:03 +0000 (19:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62602 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 29ea8be0c6760da70ae2c9e5441e86e5e216c2fe..3f9f984f41db3899aa275208d7791c6257b132c7 100644 (file)
@@ -32,15 +32,6 @@ namespace llvm {
   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 @@ namespace llvm {
     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;
     }
 
   };
index f3961f058763e206a65d0ac021a1a3e9b5e1a55d..1ff7ee7d56795a4e9e4756d22fd38c7641933fbb 100644 (file)
@@ -54,17 +54,6 @@ class Module;
 class PointerType;
 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.
 ///
index 01bfc3f35371de44e1eed249d37cba3b47e0868e..7f1677430ba68b05b38cba4fa6f9a976b122ede3 100644 (file)
 
 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 {
 
 //===----------------------------------------------------------------------===//
index 98335ae2dcca65bed9e4c3cf477bd914775135ec..34ccd0a97cf9cb5f7223ac20fbd02412db98eaf7 100644 (file)
@@ -291,9 +291,9 @@ Constant *DIFactory::getCastToEmpty(DIDescriptor D) {
 }
 
 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) {
index 88d8be1098583a91f52055c06fe0a58d7d147af6..cbe8d7048b04a44fd2565cba430a4330480acdcb 100644 (file)
@@ -1559,7 +1559,7 @@ private:
   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 @@ private:
   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 @@ private:
   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 @@ public:
     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();