summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorAmy Huang <akhuang@google.com>2019-04-19 21:09:11 +0000
committerAmy Huang <akhuang@google.com>2019-04-19 21:09:11 +0000
commitc774f687b6880484a126ed3e3d737e74c926f0ae (patch)
tree97e168eaf814536c4396b90c2abc6bcc0c5dbf0f /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parentc8eb2d0354a14a9b69cf1816dcc4e3e291023da2 (diff)
downloadbcm5719-llvm-c774f687b6880484a126ed3e3d737e74c926f0ae.tar.gz
bcm5719-llvm-c774f687b6880484a126ed3e3d737e74c926f0ae.zip
[MS] Emit S_HEAPALLOCSITE debug info
Summary: This emits labels around heapallocsite calls and S_HEAPALLOCSITE debug info in codeview. Currently only changes FastISel, so emitting labels still needs to be implemented in SelectionDAG. Reviewers: hans, rnk Subscribers: aprantl, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D60800 llvm-svn: 358783
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 89cd7a8e3bd..8ca30d03bb0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -1072,6 +1072,23 @@ void CodeViewDebug::emitDebugInfoForFunction(const Function *GV,
endSymbolRecord(AnnotEnd);
}
+ for (auto HeapAllocSite : FI.HeapAllocSites) {
+ MCSymbol *BeginLabel = std::get<0>(HeapAllocSite);
+ MCSymbol *EndLabel = std::get<1>(HeapAllocSite);
+ DIType *DITy = std::get<2>(HeapAllocSite);
+
+ MCSymbol *HeapAllocEnd = beginSymbolRecord(SymbolKind::S_HEAPALLOCSITE);
+ OS.AddComment("Call site offset");
+ OS.EmitCOFFSecRel32(BeginLabel, /*Offset=*/0);
+ OS.AddComment("Call site section index");
+ OS.EmitCOFFSectionIndex(BeginLabel);
+ OS.AddComment("Call instruction length");
+ OS.emitAbsoluteSymbolDiff(EndLabel, BeginLabel, 2);
+ OS.AddComment("Type index");
+ OS.EmitIntValue(getCompleteTypeIndex(DITy).getIndex(), 4);
+ endSymbolRecord(HeapAllocEnd);
+ }
+
if (SP != nullptr)
emitDebugInfoForUDTs(LocalUDTs);
@@ -2807,6 +2824,7 @@ void CodeViewDebug::endFunctionImpl(const MachineFunction *MF) {
}
CurFn->Annotations = MF->getCodeViewAnnotations();
+ CurFn->HeapAllocSites = MF->getCodeViewHeapAllocSites();
CurFn->End = Asm->getFunctionEnd();
OpenPOWER on IntegriCloud