summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-07-28 23:23:29 +0000
committerDevang Patel <dpatel@apple.com>2010-07-28 23:23:29 +0000
commitc7f16ab3e3f27d944db72908c9c1b1b7366f5515 (patch)
tree641cfda16e9b380eba30c91b9e6123a4eeb0d3c4 /clang/lib/CodeGen/CGDebugInfo.cpp
parent716a596cf7d2920c55bce9319e8e64ce3e5b7a02 (diff)
downloadbcm5719-llvm-c7f16ab3e3f27d944db72908c9c1b1b7366f5515.tar.gz
bcm5719-llvm-c7f16ab3e3f27d944db72908c9c1b1b7366f5515.zip
Override selected builtin names (e.g. "long int" instead of "long") to match names used by gcc in debug info. This makes gdb testsuite happy.
llvm-svn: 109694
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 1bdc91016b0..c54196cc27e 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -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;
OpenPOWER on IntegriCloud