diff options
author | Vedant Kumar <vsk@apple.com> | 2020-02-06 13:14:27 -0800 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2020-02-07 10:10:41 -0800 |
commit | 0d0ef315cb2004c70ab27482dc41dd046a372d1e (patch) | |
tree | 12417133f3b0999c09490ce59d44f81083b9cd38 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | e21b39a86dd6e8d1a5a5fe7e0286f8570732834d (diff) | |
download | llvm-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.cpp | 14 |
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()) |