Goodbye nasty macro.
authorJim Laskey <jlaskey@mac.com>
Mon, 6 Feb 2006 21:54:05 +0000 (21:54 +0000)
committerJim Laskey <jlaskey@mac.com>
Mon, 6 Feb 2006 21:54:05 +0000 (21:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26019 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineDebugInfo.h
lib/CodeGen/MachineDebugInfo.cpp

index a96525eb31569b557185533a663c9e2dd2755f6c..c7fe55a267a10d651d362a315014533459e60d68 100644 (file)
@@ -51,11 +51,9 @@ class StructType;
 //===----------------------------------------------------------------------===//
 // Debug info constants.
 
-// Invalid result indicator.
-#define DIINVALID (~0U)
-
 enum {
   LLVMDebugVersion = 1,                 // Current version of debug information.
+  DIInvalid = ~0U,                      // Invalid result indicator.
   
   // DebugInfoDesc type identifying tags.
   // FIXME - Change over with gcc4.
index 9cc8cae4ac00be202d5e80412946ab75b67b15c8..28fc9c306f8da7790f848312b36722e7520e1a29 100644 (file)
@@ -175,7 +175,7 @@ static ConstantUInt *getUIntOperand(GlobalVariable *GV, unsigned i) {
 /// GlobalVariable.  
 unsigned DebugInfoDesc::TagFromGlobal(GlobalVariable *GV) {
   ConstantUInt *C = getUIntOperand(GV, 0);
-  return C ? C->getValue() : DIINVALID;
+  return C ? (unsigned)C->getValue() : (unsigned)DIInvalid;
 }
 
 /// DescFactory - Create an instance of debug info descriptor based on Tag.
@@ -416,7 +416,7 @@ public:
 /// GlobalVariable.
 unsigned CompileUnitDesc::DebugVersionFromGlobal(GlobalVariable *GV) {
   ConstantUInt *C = getUIntOperand(GV, 1);
-  return C ? C->getValue() : DIINVALID;
+  return C ? (unsigned)C->getValue() : (unsigned)DIInvalid;
 }
   
 /// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc.
@@ -684,12 +684,12 @@ bool DIVerifier::Verify(GlobalVariable *GV) {
   
   // Get the Tag
   unsigned Tag = DebugInfoDesc::TagFromGlobal(GV);
-  if (Tag == DIINVALID) return false;
+  if (Tag == DIInvalid) return false;
 
   // If a compile unit we need the debug version.
   if (Tag == DI_TAG_compile_unit) {
     DebugVersion = CompileUnitDesc::DebugVersionFromGlobal(GV);
-    if (DebugVersion == DIINVALID) return false;
+    if (DebugVersion == DIInvalid) return false;
   }
 
   // Construct an empty DebugInfoDesc.