summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/DwarfWriter.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-10-13 13:02:19 +0000
committerJim Laskey <jlaskey@mac.com>2006-10-13 13:02:19 +0000
commitccee9baebea973ce5aef678d10c073c83ba5b03c (patch)
treebe4eb0b13c319ff58748197d67d8eaeee15fa4c6 /llvm/lib/CodeGen/DwarfWriter.cpp
parent13d3373e72bf56111cae01ef90c6d372c36cc9cf (diff)
downloadbcm5719-llvm-ccee9baebea973ce5aef678d10c073c83ba5b03c.tar.gz
bcm5719-llvm-ccee9baebea973ce5aef678d10c073c83ba5b03c.zip
Workaround for templates
llvm-svn: 30927
Diffstat (limited to 'llvm/lib/CodeGen/DwarfWriter.cpp')
-rw-r--r--llvm/lib/CodeGen/DwarfWriter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/DwarfWriter.cpp b/llvm/lib/CodeGen/DwarfWriter.cpp
index aa393f36784..9065607ca5e 100644
--- a/llvm/lib/CodeGen/DwarfWriter.cpp
+++ b/llvm/lib/CodeGen/DwarfWriter.cpp
@@ -1267,6 +1267,7 @@ DIE *DwarfWriter::NewType(DIE *Context, TypeDesc *TyDesc, CompileUnit *Unit) {
// Type DIE result.
DIE *Ty = NULL;
+ // FIXME - Not sure why programs and variables are coming through here.
// Short cut for handling subprogram types (not really a TyDesc.)
if (SubprogramDesc *SubprogramTy = dyn_cast<SubprogramDesc>(TyDesc)) {
Slot = Ty = new DIE(DW_TAG_pointer_type);
@@ -1275,6 +1276,15 @@ DIE *DwarfWriter::NewType(DIE *Context, TypeDesc *TyDesc, CompileUnit *Unit) {
Context->AddChild(Ty);
return Slot;
}
+ // Short cut for handling global variable types (not really a TyDesc.)
+ if (GlobalVariableDesc *GlobalVariableTy =
+ dyn_cast<GlobalVariableDesc>(TyDesc)) {
+ Slot = Ty = new DIE(DW_TAG_pointer_type);
+ Ty->AddUInt(DW_AT_byte_size, 0, TAI->getAddressSize());
+ Ty->AddString(DW_AT_name, DW_FORM_string, GlobalVariableTy->getName());
+ Context->AddChild(Ty);
+ return Slot;
+ }
// Get core information.
const std::string &Name = TyDesc->getName();
OpenPOWER on IntegriCloud