diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-10-13 13:02:19 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-10-13 13:02:19 +0000 |
commit | 339ec4cb15cba923605bafdbd20dcfe30caffc0e (patch) | |
tree | 4d26fec3d12529d15e9d06dbeef678abd7bbfedc | |
parent | 774f85465e72c95c39f71cb3eb9008f7e89c3673 (diff) |
Workaround for templates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30927 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/DwarfWriter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index aa393f3678..9065607ca5 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/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(); |