forked from OSchip/llvm-project
Remove dependence on the return type of ConstantArray::get
llvm-svn: 11463
This commit is contained in:
parent
5d56c478ba
commit
c75bf528c1
|
@ -89,7 +89,7 @@ bool EmitFunctionTable::run(Module &M){
|
||||||
cstruct, "llvmFunctionTable");
|
cstruct, "llvmFunctionTable");
|
||||||
M.getGlobalList().push_back(gb);
|
M.getGlobalList().push_back(gb);
|
||||||
|
|
||||||
ConstantArray *constArray = ConstantArray::get(ArrayType::get(Type::SByteTy,
|
Constant *constArray = ConstantArray::get(ArrayType::get(Type::SByteTy,
|
||||||
sBCons.size()),
|
sBCons.size()),
|
||||||
sBCons);
|
sBCons);
|
||||||
|
|
||||||
|
|
|
@ -434,7 +434,7 @@ void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To,
|
||||||
Values.push_back(Val);
|
Values.push_back(Val);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstantArray *Replacement = ConstantArray::get(getType(), Values);
|
Constant *Replacement = ConstantArray::get(getType(), Values);
|
||||||
assert(Replacement != this && "I didn't contain From!");
|
assert(Replacement != this && "I didn't contain From!");
|
||||||
|
|
||||||
// Everyone using this now uses the replacement...
|
// Everyone using this now uses the replacement...
|
||||||
|
|
|
@ -173,7 +173,7 @@ StackerCompiler::compile(
|
||||||
TheExit = new Function(
|
TheExit = new Function(
|
||||||
exit_type, GlobalValue::ExternalLinkage, "exit", TheModule);
|
exit_type, GlobalValue::ExternalLinkage, "exit", TheModule);
|
||||||
|
|
||||||
ConstantArray* str_format = ConstantArray::get("%s");
|
Constant* str_format = ConstantArray::get("%s");
|
||||||
StrFormat = new GlobalVariable(
|
StrFormat = new GlobalVariable(
|
||||||
/*type=*/ArrayType::get( Type::SByteTy, 3 ),
|
/*type=*/ArrayType::get( Type::SByteTy, 3 ),
|
||||||
/*isConstant=*/true,
|
/*isConstant=*/true,
|
||||||
|
@ -183,7 +183,7 @@ StackerCompiler::compile(
|
||||||
/*parent=*/TheModule
|
/*parent=*/TheModule
|
||||||
);
|
);
|
||||||
|
|
||||||
ConstantArray* in_str_format = ConstantArray::get(" %as");
|
Constant* in_str_format = ConstantArray::get(" %as");
|
||||||
InStrFormat = new GlobalVariable(
|
InStrFormat = new GlobalVariable(
|
||||||
/*type=*/ArrayType::get( Type::SByteTy, 5 ),
|
/*type=*/ArrayType::get( Type::SByteTy, 5 ),
|
||||||
/*isConstant=*/true,
|
/*isConstant=*/true,
|
||||||
|
@ -193,7 +193,7 @@ StackerCompiler::compile(
|
||||||
/*parent=*/TheModule
|
/*parent=*/TheModule
|
||||||
);
|
);
|
||||||
|
|
||||||
ConstantArray* num_format = ConstantArray::get("%d");
|
Constant* num_format = ConstantArray::get("%d");
|
||||||
NumFormat = new GlobalVariable(
|
NumFormat = new GlobalVariable(
|
||||||
/*type=*/ArrayType::get( Type::SByteTy, 3 ),
|
/*type=*/ArrayType::get( Type::SByteTy, 3 ),
|
||||||
/*isConstant=*/true,
|
/*isConstant=*/true,
|
||||||
|
@ -203,7 +203,7 @@ StackerCompiler::compile(
|
||||||
/*parent=*/TheModule
|
/*parent=*/TheModule
|
||||||
);
|
);
|
||||||
|
|
||||||
ConstantArray* in_num_format = ConstantArray::get(" %d");
|
Constant* in_num_format = ConstantArray::get(" %d");
|
||||||
InNumFormat = new GlobalVariable(
|
InNumFormat = new GlobalVariable(
|
||||||
/*type=*/ArrayType::get( Type::SByteTy, 4 ),
|
/*type=*/ArrayType::get( Type::SByteTy, 4 ),
|
||||||
/*isConstant=*/true,
|
/*isConstant=*/true,
|
||||||
|
@ -213,7 +213,7 @@ StackerCompiler::compile(
|
||||||
/*parent=*/TheModule
|
/*parent=*/TheModule
|
||||||
);
|
);
|
||||||
|
|
||||||
ConstantArray* chr_format = ConstantArray::get("%c");
|
Constant* chr_format = ConstantArray::get("%c");
|
||||||
ChrFormat = new GlobalVariable(
|
ChrFormat = new GlobalVariable(
|
||||||
/*type=*/ArrayType::get( Type::SByteTy, 3 ),
|
/*type=*/ArrayType::get( Type::SByteTy, 3 ),
|
||||||
/*isConstant=*/true,
|
/*isConstant=*/true,
|
||||||
|
@ -223,7 +223,7 @@ StackerCompiler::compile(
|
||||||
/*parent=*/TheModule
|
/*parent=*/TheModule
|
||||||
);
|
);
|
||||||
|
|
||||||
ConstantArray* in_chr_format = ConstantArray::get(" %c");
|
Constant* in_chr_format = ConstantArray::get(" %c");
|
||||||
InChrFormat = new GlobalVariable(
|
InChrFormat = new GlobalVariable(
|
||||||
/*type=*/ArrayType::get( Type::SByteTy, 4 ),
|
/*type=*/ArrayType::get( Type::SByteTy, 4 ),
|
||||||
/*isConstant=*/true,
|
/*isConstant=*/true,
|
||||||
|
@ -413,7 +413,7 @@ StackerCompiler::push_string( BasicBlock* bb, const char* value )
|
||||||
ArrayType* char_array = ArrayType::get( Type::SByteTy, len + 1 );
|
ArrayType* char_array = ArrayType::get( Type::SByteTy, len + 1 );
|
||||||
|
|
||||||
// Create an initializer for the value
|
// Create an initializer for the value
|
||||||
ConstantArray* initVal = ConstantArray::get( value );
|
Constant* initVal = ConstantArray::get( value );
|
||||||
|
|
||||||
// Create an internal linkage global variable to hold the constant.
|
// Create an internal linkage global variable to hold the constant.
|
||||||
GlobalVariable* strconst = new GlobalVariable(
|
GlobalVariable* strconst = new GlobalVariable(
|
||||||
|
|
Loading…
Reference in New Issue