Add a 'tail' marker for call instructions, patch contributed by

Alexander Friedman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21722 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2005-05-06 05:51:46 +00:00
parent 2bff524501
commit ddb6db4fa1
5 changed files with 34 additions and 7 deletions

View File

@ -467,7 +467,8 @@ public:
//===----------------------------------------------------------------------===//
/// CallInst - This class represents a function call, abstracting a target
/// machine's calling convention.
/// machine's calling convention. This class uses the SubClassData field to
/// indicate whether or not this is a tail call.
///
class CallInst : public Instruction {
CallInst(const CallInst &CI);
@ -501,6 +502,9 @@ public:
virtual CallInst *clone() const;
bool mayWriteToMemory() const { return true; }
bool isTailCall() const { return SubclassData; }
void setTailCall(bool isTailCall) { SubclassData = isTailCall; }
/// getCalledFunction - Return the function being called by this instruction
/// if it is a direct call. If it is a call through a function pointer,
/// return null.