diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-04-16 01:16:20 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-04-16 01:16:20 +0000 |
commit | 607a7ab3da72a2eb53553a520507cbb8068dd1d8 (patch) | |
tree | a24f057eee6bdd4edd74d509424b13bed1dda2de /lib/Transforms/Utils/BuildLibCalls.cpp | |
parent | 5f0378251c4b682b51d194fce45da1587ed9c97b (diff) |
back out r101423 and r101397, they break llvm-gcc self-host on darwin10
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/BuildLibCalls.cpp')
-rw-r--r-- | lib/Transforms/Utils/BuildLibCalls.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/Transforms/Utils/BuildLibCalls.cpp b/lib/Transforms/Utils/BuildLibCalls.cpp index 1e204305db..767fa3a0a6 100644 --- a/lib/Transforms/Utils/BuildLibCalls.cpp +++ b/lib/Transforms/Utils/BuildLibCalls.cpp @@ -395,11 +395,11 @@ bool SimplifyFortifiedLibCalls::fold(CallInst *CI, const TargetData *TD) { FT->getParamType(2) != TD->getIntPtrType(Context) || FT->getParamType(3) != TD->getIntPtrType(Context)) return false; - - if (isFoldable(3, 2, false)) { - EmitMemCpy(CI->getOperand(0), CI->getOperand(1), CI->getOperand(2), + + if (isFoldable(4, 3, false)) { + EmitMemCpy(CI->getOperand(1), CI->getOperand(2), CI->getOperand(3), 1, false, B, TD); - replaceCall(CI->getOperand(0)); + replaceCall(CI->getOperand(1)); return true; } return false; @@ -418,11 +418,11 @@ bool SimplifyFortifiedLibCalls::fold(CallInst *CI, const TargetData *TD) { FT->getParamType(2) != TD->getIntPtrType(Context) || FT->getParamType(3) != TD->getIntPtrType(Context)) return false; - - if (isFoldable(3, 2, false)) { - EmitMemMove(CI->getOperand(0), CI->getOperand(1), CI->getOperand(2), + + if (isFoldable(4, 3, false)) { + EmitMemMove(CI->getOperand(1), CI->getOperand(2), CI->getOperand(3), 1, false, B, TD); - replaceCall(CI->getOperand(0)); + replaceCall(CI->getOperand(1)); return true; } return false; @@ -436,12 +436,12 @@ bool SimplifyFortifiedLibCalls::fold(CallInst *CI, const TargetData *TD) { FT->getParamType(2) != TD->getIntPtrType(Context) || FT->getParamType(3) != TD->getIntPtrType(Context)) return false; - - if (isFoldable(3, 2, false)) { - Value *Val = B.CreateIntCast(CI->getOperand(1), B.getInt8Ty(), + + if (isFoldable(4, 3, false)) { + Value *Val = B.CreateIntCast(CI->getOperand(2), B.getInt8Ty(), false); - EmitMemSet(CI->getOperand(0), Val, CI->getOperand(2), false, B, TD); - replaceCall(CI->getOperand(0)); + EmitMemSet(CI->getOperand(1), Val, CI->getOperand(3), false, B, TD); + replaceCall(CI->getOperand(1)); return true; } return false; @@ -462,8 +462,8 @@ bool SimplifyFortifiedLibCalls::fold(CallInst *CI, const TargetData *TD) { // st[rp]cpy_chk call which may fail at runtime if the size is too long. // TODO: It might be nice to get a maximum length out of the possible // string lengths for varying. - if (isFoldable(2, 1, true)) { - Value *Ret = EmitStrCpy(CI->getOperand(0), CI->getOperand(1), B, TD, + if (isFoldable(3, 2, true)) { + Value *Ret = EmitStrCpy(CI->getOperand(1), CI->getOperand(2), B, TD, Name.substr(2, 6)); replaceCall(Ret); return true; @@ -479,10 +479,10 @@ bool SimplifyFortifiedLibCalls::fold(CallInst *CI, const TargetData *TD) { !FT->getParamType(2)->isIntegerTy() || FT->getParamType(3) != TD->getIntPtrType(Context)) return false; - - if (isFoldable(3, 2, false)) { - Value *Ret = EmitStrNCpy(CI->getOperand(0), CI->getOperand(1), - CI->getOperand(2), B, TD, Name.substr(2, 7)); + + if (isFoldable(4, 3, false)) { + Value *Ret = EmitStrNCpy(CI->getOperand(1), CI->getOperand(2), + CI->getOperand(3), B, TD, Name.substr(2, 7)); replaceCall(Ret); return true; } |