Clarify some constants.
authorJim Laskey <jlaskey@mac.com>
Fri, 26 Jan 2007 14:19:17 +0000 (14:19 +0000)
committerJim Laskey <jlaskey@mac.com>
Fri, 26 Jan 2007 14:19:17 +0000 (14:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33536 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/DwarfWriter.cpp

index d3e996ba67db6f4db190b5e8b55437f445cac071..15386048058e1358fdc472345e9a4651f51967cf 100644 (file)
@@ -878,7 +878,7 @@ public:
     EmitReference(Label.Tag, Label.Number);
   }
   void EmitReference(const char *Tag, unsigned Number) const {
-    if (TAI->getAddressSize() == 4)
+    if (TAI->getAddressSize() == sizeof(int32_t))
       O << TAI->getData32bitsDirective();
     else
       O << TAI->getData64bitsDirective();
@@ -886,7 +886,7 @@ public:
     PrintLabelName(Tag, Number);
   }
   void EmitReference(const std::string &Name) const {
-    if (TAI->getAddressSize() == 4)
+    if (TAI->getAddressSize() == sizeof(int32_t))
       O << TAI->getData32bitsDirective();
     else
       O << TAI->getData64bitsDirective();
@@ -1208,7 +1208,7 @@ private:
   ///
   void AddType(DIE *Entity, TypeDesc *TyDesc, CompileUnit *Unit) {
     if (!TyDesc) {
-      AddBasicType(Entity, Unit, "", DW_ATE_signed, 4);
+      AddBasicType(Entity, Unit, "", DW_ATE_signed, sizeof(int32_t));
     } else {
       // Check for pre-existence.
       DIEntry *&Slot = Unit->getDIEntrySlotFor(TyDesc);
@@ -1290,7 +1290,8 @@ private:
         Size = 0;
         
         // Construct an anonymous type for index type.
-        DIE *IndexTy = ConstructBasicType(Unit, "", DW_ATE_signed, 4);
+        DIE *IndexTy = ConstructBasicType(Unit, "", DW_ATE_signed,
+                                          sizeof(int32_t));
       
         // Add subranges to array type.
         for(unsigned i = 0, N = Elements.size(); i < N; ++i) {