diff options
author | Amy Huang <akhuang@google.com> | 2019-10-25 12:40:38 -0700 |
---|---|---|
committer | Amy Huang <akhuang@google.com> | 2019-10-25 12:41:34 -0700 |
commit | 64c1f6602a029e3b0914b95d5b580e4b02fc43c1 (patch) | |
tree | a3a37e7af2eb71a14a172db742d57483932f9b75 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | cc0b9647b76178bc3869bbfff80535ad86366472 (diff) | |
download | bcm5719-llvm-64c1f6602a029e3b0914b95d5b580e4b02fc43c1.tar.gz bcm5719-llvm-64c1f6602a029e3b0914b95d5b580e4b02fc43c1.zip |
Revert "Add an instruction marker field to the ExtraInfo in MachineInstrs."
Reverting commit b85b4e5a6f8579c137fecb59a4d75d7bfb111f79 due to some
buildbot failures/ out of memory errors.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 62ad356e7f8..c6457f3626d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1100,8 +1100,14 @@ void CodeViewDebug::emitDebugInfoForFunction(const Function *GV, } for (auto HeapAllocSite : FI.HeapAllocSites) { - const MCSymbol *BeginLabel = std::get<0>(HeapAllocSite); - const MCSymbol *EndLabel = std::get<1>(HeapAllocSite); + MCSymbol *BeginLabel = std::get<0>(HeapAllocSite); + MCSymbol *EndLabel = std::get<1>(HeapAllocSite); + + // The labels might not be defined if the instruction was replaced + // somewhere in the codegen pipeline. + if (!BeginLabel->isDefined() || !EndLabel->isDefined()) + continue; + const DIType *DITy = std::get<2>(HeapAllocSite); MCSymbol *HeapAllocEnd = beginSymbolRecord(SymbolKind::S_HEAPALLOCSITE); OS.AddComment("Call site offset"); @@ -1421,16 +1427,6 @@ void CodeViewDebug::beginFunctionImpl(const MachineFunction *MF) { DebugLoc FnStartDL = PrologEndLoc.getFnDebugLoc(); maybeRecordLocation(FnStartDL, MF); } - - // Find heap alloc sites and emit labels around them. - for (const auto &MBB : *MF) { - for (const auto &MI : MBB) { - if (MI.getHeapAllocMarker()) { - requestLabelBeforeInsn(&MI); - requestLabelAfterInsn(&MI); - } - } - } } static bool shouldEmitUdt(const DIType *T) { @@ -2854,18 +2850,8 @@ void CodeViewDebug::endFunctionImpl(const MachineFunction *MF) { return; } - // Find heap alloc sites and add to list. - for (const auto &MBB : *MF) { - for (const auto &MI : MBB) { - if (MDNode *MD = MI.getHeapAllocMarker()) { - CurFn->HeapAllocSites.push_back(std::make_tuple(getLabelBeforeInsn(&MI), - getLabelAfterInsn(&MI), - dyn_cast<DIType>(MD))); - } - } - } - CurFn->Annotations = MF->getCodeViewAnnotations(); + CurFn->HeapAllocSites = MF->getCodeViewHeapAllocSites(); CurFn->End = Asm->getFunctionEnd(); |