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/OrcTestCommon.h b/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
index e76d2fa..e25c513 100644
--- a/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
+++ b/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
@@ -22,7 +22,6 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
-#include "llvm/IR/TypeBuilder.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
@@ -169,11 +168,8 @@
ModuleBuilder(LLVMContext &Context, StringRef Triple,
StringRef Name);
- template <typename FuncType>
- Function* createFunctionDecl(StringRef Name) {
- return Function::Create(
- TypeBuilder<FuncType, false>::get(M->getContext()),
- GlobalValue::ExternalLinkage, Name, M.get());
+ Function *createFunctionDecl(FunctionType *FTy, StringRef Name) {
+ return Function::Create(FTy, GlobalValue::ExternalLinkage, Name, M.get());
}
Module* getModule() { return M.get(); }
@@ -189,15 +185,9 @@
int X[256];
};
-// TypeBuilder specialization for DummyStruct.
-template <bool XCompile>
-class TypeBuilder<DummyStruct, XCompile> {
-public:
- static StructType *get(LLVMContext &Context) {
- return StructType::get(
- TypeBuilder<types::i<32>[256], XCompile>::get(Context));
- }
-};
+inline StructType *getDummyStructTy(LLVMContext &Context) {
+ return StructType::get(ArrayType::get(Type::getInt32Ty(Context), 256));
+}
template <typename HandleT, typename ModuleT>
class MockBaseLayer {