mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134982 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -23,7 +23,7 @@ TEST(ScalarEvolutionsTest, SCEVUnknownRAUW) {
|
||||
Module M("world", Context);
|
||||
|
||||
const FunctionType *FTy = FunctionType::get(Type::getVoidTy(Context),
|
||||
std::vector<const Type *>(), false);
|
||||
std::vector<Type *>(), false);
|
||||
Function *F = cast<Function>(M.getOrInsertFunction("f", FTy));
|
||||
BasicBlock *BB = BasicBlock::Create(Context, "entry", F);
|
||||
ReturnInst::Create(Context, 0, BB);
|
||||
|
@@ -21,7 +21,7 @@ using namespace llvm;
|
||||
namespace {
|
||||
|
||||
Function *makeFakeFunction() {
|
||||
std::vector<const Type*> params;
|
||||
std::vector<Type*> params;
|
||||
const FunctionType *FTy =
|
||||
FunctionType::get(Type::getVoidTy(getGlobalContext()), params, false);
|
||||
return Function::Create(FTy, GlobalValue::ExternalLinkage);
|
||||
|
@@ -37,7 +37,7 @@ using namespace llvm;
|
||||
namespace {
|
||||
|
||||
Function *makeReturnGlobal(std::string Name, GlobalVariable *G, Module *M) {
|
||||
std::vector<const Type*> params;
|
||||
std::vector<Type*> params;
|
||||
const FunctionType *FTy = FunctionType::get(G->getType()->getElementType(),
|
||||
params, false);
|
||||
Function *F = Function::Create(FTy, GlobalValue::ExternalLinkage, Name, M);
|
||||
@@ -322,7 +322,7 @@ TEST_F(JITTest, NonLazyCompilationStillNeedsStubs) {
|
||||
|
||||
const FunctionType *Func1Ty =
|
||||
cast<FunctionType>(TypeBuilder<void(void), false>::get(Context));
|
||||
std::vector<const Type*> arg_types;
|
||||
std::vector<Type*> arg_types;
|
||||
arg_types.push_back(Type::getInt1Ty(Context));
|
||||
const FunctionType *FuncTy = FunctionType::get(
|
||||
Type::getVoidTy(Context), arg_types, false);
|
||||
|
@@ -120,7 +120,7 @@ TEST(TypeBuilderTest, Derived) {
|
||||
}
|
||||
|
||||
TEST(TypeBuilderTest, Functions) {
|
||||
std::vector<const Type*> params;
|
||||
std::vector<Type*> params;
|
||||
EXPECT_EQ(FunctionType::get(Type::getVoidTy(getGlobalContext()), params, false),
|
||||
(TypeBuilder<void(), true>::get(getGlobalContext())));
|
||||
EXPECT_EQ(FunctionType::get(Type::getInt8Ty(getGlobalContext()), params, true),
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
static const StructType *get(LLVMContext &Context) {
|
||||
// Using the static result variable ensures that the type is
|
||||
// only looked up once.
|
||||
std::vector<const Type*> st;
|
||||
std::vector<Type*> st;
|
||||
st.push_back(TypeBuilder<int, cross>::get(Context));
|
||||
st.push_back(TypeBuilder<int*, cross>::get(Context));
|
||||
st.push_back(TypeBuilder<void*[], cross>::get(Context));
|
||||
@@ -210,7 +210,7 @@ public:
|
||||
static const StructType *get(LLVMContext &Context) {
|
||||
// Using the static result variable ensures that the type is
|
||||
// only looked up once.
|
||||
std::vector<const Type*> st;
|
||||
std::vector<Type*> st;
|
||||
st.push_back(TypeBuilder<types::i<32>, cross>::get(Context));
|
||||
st.push_back(TypeBuilder<types::i<32>*, cross>::get(Context));
|
||||
st.push_back(TypeBuilder<types::i<8>*[], cross>::get(Context));
|
||||
|
@@ -405,13 +405,13 @@ namespace llvm {
|
||||
mod->setTargetTriple("x86_64-unknown-linux-gnu");
|
||||
|
||||
// Type Definitions
|
||||
std::vector<const Type*>FuncTy_0_args;
|
||||
std::vector<Type*>FuncTy_0_args;
|
||||
FunctionType* FuncTy_0 = FunctionType::get(
|
||||
/*Result=*/IntegerType::get(getGlobalContext(), 32),
|
||||
/*Params=*/FuncTy_0_args,
|
||||
/*isVarArg=*/false);
|
||||
|
||||
std::vector<const Type*>FuncTy_2_args;
|
||||
std::vector<Type*>FuncTy_2_args;
|
||||
FuncTy_2_args.push_back(IntegerType::get(getGlobalContext(), 1));
|
||||
FunctionType* FuncTy_2 = FunctionType::get(
|
||||
/*Result=*/Type::getVoidTy(getGlobalContext()),
|
||||
|
Reference in New Issue
Block a user