[llvm-commits] [llvm] r95040 - /llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
Eric Christopher
echristo at apple.com
Mon Feb 1 16:51:45 PST 2010
Author: echristo
Date: Mon Feb 1 18:51:45 2010
New Revision: 95040
URL: http://llvm.org/viewvc/llvm-project?rev=95040&view=rev
Log:
Don't need to check the last argument since it'll always be bool. We also
don't use TargetData here.
Modified:
llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=95040&r1=95039&r2=95040&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Mon Feb 1 18:51:45 2010
@@ -1203,14 +1203,10 @@
struct StrCpyChkOpt : public LibCallOptimization {
virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder<> &B) {
- // These optimizations require TargetData.
- if (!TD) return 0;
-
const FunctionType *FT = Callee->getFunctionType();
if (FT->getNumParams() != 3 || FT->getReturnType() != FT->getParamType(0) ||
!isa<PointerType>(FT->getParamType(0)) ||
- !isa<PointerType>(FT->getParamType(1)) ||
- !isa<IntegerType>(FT->getParamType(2)))
+ !isa<PointerType>(FT->getParamType(1)))
return 0;
ConstantInt *SizeCI = dyn_cast<ConstantInt>(CI->getOperand(3));
More information about the llvm-commits
mailing list