diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-23 14:19:52 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-23 14:19:52 +0000 |
commit | 9643cca39fb9fb3b49a8912926de98acf882283c (patch) | |
tree | 22cc59e4b240d84c3a5a60531119c4eca914a256 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 1adacceba9c9ee0f16e54388e56c9a249b296f75 (diff) | |
download | FreeBSD-src-9643cca39fb9fb3b49a8912926de98acf882283c.zip FreeBSD-src-9643cca39fb9fb3b49a8912926de98acf882283c.tar.gz |
Update LLVM to r84949.
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2914851..d50e5e3 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -923,7 +923,7 @@ void DwarfDebug::ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer, AddType(DW_Unit, &Buffer, FromTy); // Add name if not anonymous or intermediate type. - if (Name) + if (Name && Tag != dwarf::DW_TAG_pointer_type) AddString(&Buffer, dwarf::DW_AT_name, dwarf::DW_FORM_string, Name); // Add size if non-zero (derived types might be zero-sized.) @@ -1811,10 +1811,18 @@ void DwarfDebug::CollectVariableInfo() { DIVariable DV (Var); if (DV.isNull()) continue; unsigned VSlot = VI->second; + DbgScope *Scope = NULL; DenseMap<MDNode *, DbgScope *>::iterator DSI = DbgScopeMap.find(DV.getContext().getNode()); - assert (DSI != DbgScopeMap.end() && "Unable to find variable scope!"); - DbgScope *Scope = DSI->second; + if (DSI != DbgScopeMap.end()) + Scope = DSI->second; + else + // There is not any instruction assocated with this scope, so get + // a new scope. + Scope = getDbgScope(DV.getContext().getNode(), + NULL /* Not an instruction */, + NULL /* Not inlined */); + assert (Scope && "Unable to find variable scope!"); Scope->AddVariable(new DbgVariable(DV, VSlot, false)); } } |