Add missing casts. This fixed some regressions.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 16 Jun 2006 18:37:15 +0000 (18:37 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 16 Jun 2006 18:37:15 +0000 (18:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28834 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/SimplifyLibCalls.cpp

index b598fc5a3901b822fc334d8098d656842dc55b98..d8415d74b84d03d81e5581176860db043d7556a4 100644 (file)
@@ -1340,7 +1340,7 @@ public:
         if (!puts_func)
           return false;
         std::vector<Value*> args;
-        args.push_back(ci->getOperand(2));
+        args.push_back(CastToCStr(ci->getOperand(2), *ci));
         new CallInst(puts_func,args,ci->getName(),ci);
         ci->replaceAllUsesWith(ConstantSInt::get(Type::IntTy,len));
         break;
@@ -1474,7 +1474,7 @@ public:
           if (!fputs_func)
             return false;
           std::vector<Value*> args;
-          args.push_back(ci->getOperand(3));
+          args.push_back(CastToCStr(ci->getOperand(3), *ci));
           args.push_back(ci->getOperand(1));
           new CallInst(fputs_func,args,ci->getName(),ci);
           ci->replaceAllUsesWith(ConstantSInt::get(Type::IntTy,len));