diff options
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfException.cpp | 30 |
2 files changed, 17 insertions, 27 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)); } } diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 626523b..6c03b55 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -871,28 +871,7 @@ void DwarfException::EmitExceptionTable() { Asm->EOL("Next action"); } - // Emit the Catch Clauses. The code for the catch clauses following the same - // try is similar to a switch statement. The catch clause action record - // informs the runtime about the type of a catch clause and about the - // associated switch value. - // - // Action Record Fields: - // - // * Filter Value - // Positive value, starting at 1. Index in the types table of the - // __typeinfo for the catch-clause type. 1 is the first word preceding - // TTBase, 2 is the second word, and so on. Used by the runtime to check - // if the thrown exception type matches the catch-clause type. Back-end - // generated switch statements check against this value. - // - // * Next - // Signed offset, in bytes from the start of this field, to the next - // chained action record, or zero if none. - // - // The order of the action records determined by the next field is the order - // of the catch clauses as they appear in the source code, and must be kept in - // the same order. As a result, changing the order of the catch clause would - // change the semantics of the program. + // Emit the Catch TypeInfos. for (std::vector<GlobalVariable *>::const_reverse_iterator I = TypeInfos.rbegin(), E = TypeInfos.rend(); I != E; ++I) { const GlobalVariable *GV = *I; @@ -907,12 +886,15 @@ void DwarfException::EmitExceptionTable() { Asm->EOL("TypeInfo"); } - // Emit the Type Table. + // Emit the Exception Specifications. for (std::vector<unsigned>::const_iterator I = FilterIds.begin(), E = FilterIds.end(); I < E; ++I) { unsigned TypeID = *I; Asm->EmitULEB128Bytes(TypeID); - Asm->EOL("Filter TypeInfo index"); + if (TypeID != 0) + Asm->EOL("Exception specification"); + else + Asm->EOL(); } Asm->EmitAlignment(2, 0, 0, false); |