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
diff --git a/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
index 6b1dbe9..2db237f 100644
--- a/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
@@ -131,13 +131,17 @@
ModuleBuilder MB(*TSCtx.getContext(), TM->getTargetTriple().str(), "dummy");
MB.getModule()->setDataLayout(TM->createDataLayout());
- Function *FooImpl = MB.createFunctionDecl<void()>("foo");
+ Function *FooImpl = MB.createFunctionDecl(
+ FunctionType::get(Type::getVoidTy(*TSCtx.getContext()), {}, false),
+ "foo");
BasicBlock *FooEntry =
BasicBlock::Create(*TSCtx.getContext(), "entry", FooImpl);
IRBuilder<> B1(FooEntry);
B1.CreateRetVoid();
- Function *BarImpl = MB.createFunctionDecl<void()>("bar");
+ Function *BarImpl = MB.createFunctionDecl(
+ FunctionType::get(Type::getVoidTy(*TSCtx.getContext()), {}, false),
+ "bar");
BasicBlock *BarEntry =
BasicBlock::Create(*TSCtx.getContext(), "entry", BarImpl);
IRBuilder<> B2(BarEntry);
@@ -181,9 +185,9 @@
FunkySimpleCompiler(TargetMachine &TM) : SimpleCompiler(TM) {}
CompileResult operator()(Module &M) {
- Function *BarImpl =
- Function::Create(TypeBuilder<void(), false>::get(M.getContext()),
- GlobalValue::ExternalLinkage, "bar", &M);
+ Function *BarImpl = Function::Create(
+ FunctionType::get(Type::getVoidTy(M.getContext()), {}, false),
+ GlobalValue::ExternalLinkage, "bar", &M);
BasicBlock *BarEntry =
BasicBlock::Create(M.getContext(), "entry", BarImpl);
IRBuilder<> B(BarEntry);
@@ -200,7 +204,9 @@
ModuleBuilder MB(*TSCtx.getContext(), TM->getTargetTriple().str(), "dummy");
MB.getModule()->setDataLayout(TM->createDataLayout());
- Function *FooImpl = MB.createFunctionDecl<void()>("foo");
+ Function *FooImpl = MB.createFunctionDecl(
+ FunctionType::get(Type::getVoidTy(*TSCtx.getContext()), {}, false),
+ "foo");
BasicBlock *FooEntry =
BasicBlock::Create(*TSCtx.getContext(), "entry", FooImpl);
IRBuilder<> B(FooEntry);