From c0044118c8ec4889ff1490179d5d70549cb7621c Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Sun, 13 Jan 2019 16:09:28 +0000 Subject: Remove TypeBuilder.h, and fix the few locations using it. This shortcut mechanism for creating types was added 10 years ago, but has seen almost no uptake since then, neither internally nor in external projects. The very small number of characters saved by using it does not seem worth the mental overhead of an additional type-creation API, so, delete it. Differential Revision: https://reviews.llvm.org/D56573 llvm-svn: 351020 --- .../Orc/LegacyRTDyldObjectLinkingLayerTest.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp') diff --git a/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp index 8c9c958cc42..b3696c6ca4a 100644 --- a/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp @@ -123,6 +123,8 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoDuplicateFinalization) { if (!SupportsJIT) return; + Type *Int32Ty = IntegerType::get(Context, 32); + ExecutionSession ES; auto MM = std::make_shared(); @@ -153,7 +155,8 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoDuplicateFinalization) { ModuleBuilder MB1(Context, "", "dummy"); { MB1.getModule()->setDataLayout(TM->createDataLayout()); - Function *BarImpl = MB1.createFunctionDecl("bar"); + Function *BarImpl = + MB1.createFunctionDecl(FunctionType::get(Int32Ty, {}, false), "bar"); BasicBlock *BarEntry = BasicBlock::Create(Context, "entry", BarImpl); IRBuilder<> Builder(BarEntry); IntegerType *Int32Ty = IntegerType::get(Context, 32); @@ -166,8 +169,10 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoDuplicateFinalization) { ModuleBuilder MB2(Context, "", "dummy"); { MB2.getModule()->setDataLayout(TM->createDataLayout()); - Function *BarDecl = MB2.createFunctionDecl("bar"); - Function *FooImpl = MB2.createFunctionDecl("foo"); + Function *BarDecl = + MB2.createFunctionDecl(FunctionType::get(Int32Ty, {}, false), "bar"); + Function *FooImpl = + MB2.createFunctionDecl(FunctionType::get(Int32Ty, {}, false), "foo"); BasicBlock *FooEntry = BasicBlock::Create(Context, "entry", FooImpl); IRBuilder<> Builder(FooEntry); Builder.CreateRet(Builder.CreateCall(BarDecl)); @@ -207,6 +212,8 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoPrematureAllocation) { if (!SupportsJIT) return; + Type *Int32Ty = IntegerType::get(Context, 32); + ExecutionSession ES; auto MM = std::make_shared(); @@ -233,7 +240,8 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoPrematureAllocation) { ModuleBuilder MB1(Context, "", "dummy"); { MB1.getModule()->setDataLayout(TM->createDataLayout()); - Function *BarImpl = MB1.createFunctionDecl("foo"); + Function *BarImpl = + MB1.createFunctionDecl(FunctionType::get(Int32Ty, {}, false), "foo"); BasicBlock *BarEntry = BasicBlock::Create(Context, "entry", BarImpl); IRBuilder<> Builder(BarEntry); IntegerType *Int32Ty = IntegerType::get(Context, 32); @@ -246,7 +254,8 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoPrematureAllocation) { ModuleBuilder MB2(Context, "", "dummy"); { MB2.getModule()->setDataLayout(TM->createDataLayout()); - Function *BarImpl = MB2.createFunctionDecl("bar"); + Function *BarImpl = + MB2.createFunctionDecl(FunctionType::get(Int32Ty, {}, false), "bar"); BasicBlock *BarEntry = BasicBlock::Create(Context, "entry", BarImpl); IRBuilder<> Builder(BarEntry); IntegerType *Int32Ty = IntegerType::get(Context, 32); -- cgit v1.2.3