diff options
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 9 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 15 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index a417c68..ea446d4 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -737,7 +737,7 @@ bool BitcodeReader::ParseValueSymbolTable() { } bool BitcodeReader::ParseMetadata() { - unsigned NextValueNo = MDValueList.size(); + unsigned NextMDValueNo = MDValueList.size(); if (Stream.EnterSubBlock(bitc::METADATA_BLOCK_ID)) return Error("Malformed block record"); @@ -801,8 +801,7 @@ bool BitcodeReader::ParseMetadata() { } Value *V = NamedMDNode::Create(Context, Name.str(), Elts.data(), Elts.size(), TheModule); - // FIXME: This shouldn't poke NextValueNo? - MDValueList.AssignValue(V, NextValueNo++); + MDValueList.AssignValue(V, NextMDValueNo++); break; } case bitc::METADATA_FN_NODE: @@ -826,7 +825,7 @@ bool BitcodeReader::ParseMetadata() { Value *V = MDNode::getWhenValsUnresolved(Context, &Elts[0], Elts.size(), IsFunctionLocal); IsFunctionLocal = false; - MDValueList.AssignValue(V, NextValueNo++); + MDValueList.AssignValue(V, NextMDValueNo++); break; } case bitc::METADATA_STRING: { @@ -837,7 +836,7 @@ bool BitcodeReader::ParseMetadata() { String[i] = Record[i]; Value *V = MDString::get(Context, StringRef(String.data(), String.size())); - MDValueList.AssignValue(V, NextValueNo++); + MDValueList.AssignValue(V, NextMDValueNo++); break; } case bitc::METADATA_KIND: { diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f02410c..1ef3bef 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2138,13 +2138,14 @@ void DwarfDebug::endFunction(MachineFunction *MF) { } // Clear debug info - CurrentFnDbgScope = NULL; - DbgScopeMap.clear(); - DbgScopeBeginMap.clear(); - DbgScopeEndMap.clear(); - ConcreteScopes.clear(); - AbstractScopesList.clear(); - + if (CurrentFnDbgScope) { + CurrentFnDbgScope = NULL; + DbgScopeMap.clear(); + DbgScopeBeginMap.clear(); + DbgScopeEndMap.clear(); + ConcreteScopes.clear(); + AbstractScopesList.clear(); + } Lines.clear(); if (TimePassesIsEnabled) |