aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2020-02-06 13:14:27 -0800
committerVedant Kumar <vsk@apple.com>2020-02-07 10:10:41 -0800
commit0d0ef315cb2004c70ab27482dc41dd046a372d1e (patch)
tree12417133f3b0999c09490ce59d44f81083b9cd38 /llvm/lib/CodeGen/MachineInstr.cpp
parente21b39a86dd6e8d1a5a5fe7e0286f8570732834d (diff)
downloadllvm-0d0ef315cb2004c70ab27482dc41dd046a372d1e.zip
llvm-0d0ef315cb2004c70ab27482dc41dd046a372d1e.tar.gz
llvm-0d0ef315cb2004c70ab27482dc41dd046a372d1e.tar.bz2
[MachineInstr] Add isCandidateForCallSiteEntry predicate
Add the isCandidateForCallSiteEntry predicate to MachineInstr to determine whether a DWARF call site entry should be created for an instruction. For now, it's enough to have any call instruction that doesn't belong to a blacklisted set of opcodes. For these opcodes, a call site entry isn't meaningful. Differential Revision: https://reviews.llvm.org/D74159
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 08d786f..7d4a474 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -696,6 +696,20 @@ void MachineInstr::eraseFromBundle() {
getParent()->erase_instr(this);
}
+bool MachineInstr::isCandidateForCallSiteEntry() const {
+ if (!isCall(MachineInstr::IgnoreBundle))
+ return false;
+ switch (getOpcode()) {
+ case TargetOpcode::PATCHABLE_EVENT_CALL:
+ case TargetOpcode::PATCHABLE_TYPED_EVENT_CALL:
+ case TargetOpcode::PATCHPOINT:
+ case TargetOpcode::STACKMAP:
+ case TargetOpcode::STATEPOINT:
+ return false;
+ }
+ return true;
+}
+
unsigned MachineInstr::getNumExplicitOperands() const {
unsigned NumOperands = MCID->getNumOperands();
if (!MCID->isVariadic())