[llvm] r188770 - [stackprotector] Added significantly longer comment to FindPotentialTailCall to make clear its relationship to llvm::isInTailCallPosition.

Michael Gottesman mgottesman at apple.com
Tue Aug 20 01:56:23 PDT 2013


Author: mgottesman
Date: Tue Aug 20 03:56:23 2013
New Revision: 188770

URL: http://llvm.org/viewvc/llvm-project?rev=188770&view=rev
Log:
[stackprotector] Added significantly longer comment to FindPotentialTailCall to make clear its relationship to llvm::isInTailCallPosition.

Modified:
    llvm/trunk/lib/CodeGen/StackProtector.cpp

Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=188770&r1=188769&r2=188770&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StackProtector.cpp (original)
+++ llvm/trunk/lib/CodeGen/StackProtector.cpp Tue Aug 20 03:56:23 2013
@@ -280,7 +280,12 @@ static bool InstructionWillNotHaveChain(
 /// Identify if RI has a previous instruction in the "Tail Position" and return
 /// it. Otherwise return 0.
 ///
-/// This is based off of the code in llvm::isInTailCallPosition
+/// This is based off of the code in llvm::isInTailCallPosition. The difference
+/// is that it inverts the first part of llvm::isInTailCallPosition since
+/// isInTailCallPosition is checking if a call is in a tail call position, and
+/// we are searching for an unknown tail call that might be in the tail call
+/// position. Once we find the call though, the code uses the same refactored
+/// code, returnTypeIsEligibleForTailCall.
 static CallInst *FindPotentialTailCall(BasicBlock *BB, ReturnInst *RI,
                                        const TargetLoweringBase *TLI) {
   // Establish a reasonable upper bound on the maximum amount of instructions we





More information about the llvm-commits mailing list