diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-18 04:54:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-18 04:54:35 +0000 |
commit | db125cfaf57cc83e7dd7453de2d509bc8efd0e5e (patch) | |
tree | a163ac0f83da7be3f9675a122a6144b12418be09 /unittests/ExecutionEngine/JIT | |
parent | 4b3d5469fb7c25504fa20dc65640f02d79675d48 (diff) | |
download | external_llvm-db125cfaf57cc83e7dd7453de2d509bc8efd0e5e.zip external_llvm-db125cfaf57cc83e7dd7453de2d509bc8efd0e5e.tar.gz external_llvm-db125cfaf57cc83e7dd7453de2d509bc8efd0e5e.tar.bz2 |
land David Blaikie's patch to de-constify Type, with a few tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ExecutionEngine/JIT')
-rw-r--r-- | unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp | 2 | ||||
-rw-r--r-- | unittests/ExecutionEngine/JIT/JITTest.cpp | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp b/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp index 039b5e0..be5d152 100644 --- a/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp @@ -22,7 +22,7 @@ namespace { Function *makeFakeFunction() { std::vector<Type*> params; - const FunctionType *FTy = + FunctionType *FTy = FunctionType::get(Type::getVoidTy(getGlobalContext()), params, false); return Function::Create(FTy, GlobalValue::ExternalLinkage); } diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp index 9c001c4..3cac282 100644 --- a/unittests/ExecutionEngine/JIT/JITTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITTest.cpp @@ -38,13 +38,13 @@ namespace { Function *makeReturnGlobal(std::string Name, GlobalVariable *G, Module *M) { std::vector<Type*> params; - const FunctionType *FTy = FunctionType::get(G->getType()->getElementType(), + FunctionType *FTy = FunctionType::get(G->getType()->getElementType(), params, false); Function *F = Function::Create(FTy, GlobalValue::ExternalLinkage, Name, M); BasicBlock *Entry = BasicBlock::Create(M->getContext(), "entry", F); IRBuilder<> builder(Entry); Value *Load = builder.CreateLoad(G); - const Type *GTy = G->getType()->getElementType(); + Type *GTy = G->getType()->getElementType(); Value *Add = builder.CreateAdd(Load, ConstantInt::get(GTy, 1LL)); builder.CreateStore(Add, G); builder.CreateRet(Add); @@ -236,7 +236,7 @@ TEST(JIT, GlobalInFunction) { ASSERT_EQ(Error, ""); // Create a global variable. - const Type *GTy = Type::getInt32Ty(context); + Type *GTy = Type::getInt32Ty(context); GlobalVariable *G = new GlobalVariable( *M, GTy, @@ -320,11 +320,11 @@ TEST_F(JITTest, FarCallToKnownFunction) { TEST_F(JITTest, NonLazyCompilationStillNeedsStubs) { TheJIT->DisableLazyCompilation(true); - const FunctionType *Func1Ty = + FunctionType *Func1Ty = cast<FunctionType>(TypeBuilder<void(void), false>::get(Context)); std::vector<Type*> arg_types; arg_types.push_back(Type::getInt1Ty(Context)); - const FunctionType *FuncTy = FunctionType::get( + FunctionType *FuncTy = FunctionType::get( Type::getVoidTy(Context), arg_types, false); Function *Func1 = Function::Create(Func1Ty, Function::ExternalLinkage, "func1", M); @@ -377,7 +377,7 @@ TEST_F(JITTest, NonLazyLeaksNoStubs) { TheJIT->DisableLazyCompilation(true); // Create two functions with a single basic block each. - const FunctionType *FuncTy = + FunctionType *FuncTy = cast<FunctionType>(TypeBuilder<int(), false>::get(Context)); Function *Func1 = Function::Create(FuncTy, Function::ExternalLinkage, "func1", M); |