]> granicus.if.org Git - clang/commitdiff
Override selected builtin names (e.g. "long int" instead of "long") to match names...
authorDevang Patel <dpatel@apple.com>
Wed, 28 Jul 2010 23:23:29 +0000 (23:23 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 28 Jul 2010 23:23:29 +0000 (23:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109694 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 1bdc91016b0cb7a81fa3d0c32281a3df7c8becd5..c54196cc27edb966ce8b77aded1701b996104d2f 100644 (file)
@@ -247,6 +247,7 @@ void CGDebugInfo::CreateCompileUnit() {
 llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT,
                                      llvm::DIFile Unit) {
   unsigned Encoding = 0;
+  const char *BTName = NULL;
   switch (BT->getKind()) {
   default:
   case BuiltinType::Void:
@@ -306,14 +307,23 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT,
   case BuiltinType::LongDouble:
   case BuiltinType::Double:    Encoding = llvm::dwarf::DW_ATE_float; break;
   }
+
+  switch (BT->getKind()) {
+  case BuiltinType::Long:      BTName = "long int"; break;
+  case BuiltinType::LongLong:  BTName = "long long int"; break;
+  case BuiltinType::ULong:     BTName = "long unsigned int"; break;
+  case BuiltinType::ULongLong: BTName = "long long unsigned int"; break;
+  default:
+    BTName = BT->getName(CGM.getContext().getLangOptions());
+    break;
+  }
   // Bit size, align and offset of the type.
   uint64_t Size = CGM.getContext().getTypeSize(BT);
   uint64_t Align = CGM.getContext().getTypeAlign(BT);
   uint64_t Offset = 0;
-
+  
   llvm::DIType DbgTy = 
-    DebugFactory.CreateBasicType(Unit,
-                                 BT->getName(CGM.getContext().getLangOptions()),
+    DebugFactory.CreateBasicType(Unit, BTName,
                                  Unit, 0, Size, Align,
                                  Offset, /*flags*/ 0, Encoding);
   return DbgTy;