From 710c1a449dd7bee747ecf9c344a6f6d5461a158d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 24 Apr 2014 20:14:34 +0000 Subject: Add 'musttail' marker to call instructions This is similar to the 'tail' marker, except that it guarantees that tail call optimization will occur. It also comes with convervative IR verification rules that ensure that tail call optimization is possible. Reviewers: nicholas Differential Revision: http://llvm-reviews.chandlerc.com/D3240 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207143 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/LLParser.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/AsmParser/LLParser.h') diff --git a/lib/AsmParser/LLParser.h b/lib/AsmParser/LLParser.h index f5c8a5a26d..e2bf46290b 100644 --- a/lib/AsmParser/LLParser.h +++ b/lib/AsmParser/LLParser.h @@ -372,6 +372,8 @@ namespace llvm { bool ParseFunctionBody(Function &Fn); bool ParseBasicBlock(PerFunctionState &PFS); + enum TailCallType { TCT_None, TCT_Tail, TCT_MustTail }; + // Instruction Parsing. Each instruction parsing routine can return with a // normal result, an error result, or return having eaten an extra comma. enum InstResult { InstNormal = 0, InstError = 1, InstExtraComma = 2 }; @@ -398,7 +400,8 @@ namespace llvm { bool ParseShuffleVector(Instruction *&I, PerFunctionState &PFS); int ParsePHI(Instruction *&I, PerFunctionState &PFS); bool ParseLandingPad(Instruction *&I, PerFunctionState &PFS); - bool ParseCall(Instruction *&I, PerFunctionState &PFS, bool isTail); + bool ParseCall(Instruction *&I, PerFunctionState &PFS, + CallInst::TailCallKind IsTail); int ParseAlloc(Instruction *&I, PerFunctionState &PFS); int ParseLoad(Instruction *&I, PerFunctionState &PFS); int ParseStore(Instruction *&I, PerFunctionState &PFS); -- cgit v1.2.3