diff options
author | Amy Huang <akhuang@google.com> | 2019-04-19 21:09:11 +0000 |
---|---|---|
committer | Amy Huang <akhuang@google.com> | 2019-04-19 21:09:11 +0000 |
commit | c774f687b6880484a126ed3e3d737e74c926f0ae (patch) | |
tree | 97e168eaf814536c4396b90c2abc6bcc0c5dbf0f /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | c8eb2d0354a14a9b69cf1816dcc4e3e291023da2 (diff) | |
download | bcm5719-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/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 88a7d15c299..6309d6405d2 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -43,6 +43,7 @@ #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constant.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalValue.h" @@ -806,6 +807,16 @@ try_next:; return FilterID; } +void MachineFunction::addCodeViewHeapAllocSite(MachineInstr *I, MDNode *MD) { + MCSymbol *BeginLabel = Ctx.createTempSymbol("heapallocsite", true); + MCSymbol *EndLabel = Ctx.createTempSymbol("heapallocsite", true); + I->setPreInstrSymbol(*this, BeginLabel); + I->setPostInstrSymbol(*this, EndLabel); + + DIType *DI = dyn_cast<DIType>(MD); + CodeViewHeapAllocSites.push_back({BeginLabel, EndLabel, DI}); +} + /// \} //===----------------------------------------------------------------------===// |