[PATCH] D19904: XRay: Add entry and exit sleds
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Mon May 9 07:45:43 PDT 2016
majnemer added inline comments.
================
Comment at: include/llvm/Target/TargetInstrInfo.h:155-166
@@ -154,1 +154,14 @@
+ /// This returns true if the given instruction is a "normal return" as opposed
+ /// to special kinds of returns. On platforms where there may be multiple
+ /// OpCodes that signify 'normal' return instructions (like in X86), this
+ /// return true for those instructions. The default implementation excludes
+ /// known non-normal instructions.
+ virtual bool isNormalReturn(const MachineInstr *MI) const {
+ if (!MI->isReturn()) return false;
+ auto OpCode = MI->getOpcode();
+ bool IsCatchReturn = OpCode == getCatchReturnOpcode();
+ bool IsFrameDestroy = OpCode == getCallFrameDestroyOpcode();
+ return !IsCatchReturn && !IsFrameDestroy;
+ }
+
----------------
I was thinking more of a whilelist-oriented solution, something like:
`unsigned getNormalReturnOpcode() const { return NormalRetOpcode; }`
http://reviews.llvm.org/D19904
More information about the llvm-commits
mailing list