summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CodeExtractor.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
commitb83eb6447ba155342598f0fabe1f08f5baa9164a (patch)
treea5822f5fdac89033b7b16ba8e5aaf1ae10833b1c /lib/Transforms/Utils/CodeExtractor.cpp
parent6e7dd9db6bf677c9161a6ecc12f90651cf1231e0 (diff)
downloadllvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.gz
llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.bz2
llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.xz
For PR950:
This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index f264cff472..ba403450a7 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -305,7 +305,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
if (AggregateArgs) {
std::vector<Value*> Indices;
Indices.push_back(Constant::getNullValue(Type::UIntTy));
- Indices.push_back(ConstantUInt::get(Type::UIntTy, i));
+ Indices.push_back(ConstantInt::get(Type::UIntTy, i));
std::string GEPname = "gep_" + inputs[i]->getName();
TerminatorInst *TI = newFunction->begin()->getTerminator();
GetElementPtrInst *GEP = new GetElementPtrInst(AI, Indices, GEPname, TI);
@@ -392,7 +392,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
for (unsigned i = 0, e = inputs.size(); i != e; ++i) {
std::vector<Value*> Indices;
Indices.push_back(Constant::getNullValue(Type::UIntTy));
- Indices.push_back(ConstantUInt::get(Type::UIntTy, i));
+ Indices.push_back(ConstantInt::get(Type::UIntTy, i));
GetElementPtrInst *GEP =
new GetElementPtrInst(Struct, Indices,
"gep_" + StructValues[i]->getName());
@@ -418,7 +418,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
if (AggregateArgs) {
std::vector<Value*> Indices;
Indices.push_back(Constant::getNullValue(Type::UIntTy));
- Indices.push_back(ConstantUInt::get(Type::UIntTy, FirstOut + i));
+ Indices.push_back(ConstantInt::get(Type::UIntTy, FirstOut + i));
GetElementPtrInst *GEP
= new GetElementPtrInst(Struct, Indices,
"gep_reload_" + outputs[i]->getName());
@@ -439,7 +439,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
// Now we can emit a switch statement using the call as a value.
SwitchInst *TheSwitch =
- new SwitchInst(ConstantUInt::getNullValue(Type::UShortTy),
+ new SwitchInst(ConstantInt::getNullValue(Type::UShortTy),
codeReplacer, 0, codeReplacer);
// Since there may be multiple exits from the original region, make the new
@@ -473,14 +473,14 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
brVal = ConstantBool::get(!SuccNum);
break;
default:
- brVal = ConstantUInt::get(Type::UShortTy, SuccNum);
+ brVal = ConstantInt::get(Type::UShortTy, SuccNum);
break;
}
ReturnInst *NTRet = new ReturnInst(brVal, NewTarget);
// Update the switch instruction.
- TheSwitch->addCase(ConstantUInt::get(Type::UShortTy, SuccNum),
+ TheSwitch->addCase(ConstantInt::get(Type::UShortTy, SuccNum),
OldTarget);
// Restore values just before we exit
@@ -519,7 +519,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
if (AggregateArgs) {
std::vector<Value*> Indices;
Indices.push_back(Constant::getNullValue(Type::UIntTy));
- Indices.push_back(ConstantUInt::get(Type::UIntTy,FirstOut+out));
+ Indices.push_back(ConstantInt::get(Type::UIntTy,FirstOut+out));
GetElementPtrInst *GEP =
new GetElementPtrInst(OAI, Indices,
"gep_" + outputs[out]->getName(),