Skip to content

Commit c004411

Browse files
committed
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
1 parent 06e3950 commit c004411

17 files changed

+123
-831
lines changed

llvm/docs/ExtendingLLVM.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,6 @@ Adding a fundamental type
253253
add enum ``LLVMTypeKind`` and modify
254254
``LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)`` for the new type
255255

256-
#. ``llvm/include/llvm/IR/TypeBuilder.h``:
257-
258-
add new class to represent new type in the hierarchy
259-
260256
#. ``llvm/lib/AsmParser/LLLexer.cpp``:
261257

262258
add ability to parse in the type from text assembly
@@ -299,10 +295,6 @@ Adding a derived type
299295
add enum ``LLVMTypeKind`` and modify
300296
`LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)` for the new type
301297

302-
#. ``llvm/include/llvm/IR/TypeBuilder.h``:
303-
304-
add new class to represent new class in the hierarchy
305-
306298
#. ``llvm/lib/AsmParser/LLLexer.cpp``:
307299

308300
modify ``lltok::Kind LLLexer::LexIdentifier()`` to add ability to

llvm/docs/ProgrammersManual.rst

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,37 +2905,6 @@ For example:
29052905
GV->eraseFromParent();
29062906

29072907

2908-
.. _create_types:
2909-
2910-
How to Create Types
2911-
-------------------
2912-
2913-
In generating IR, you may need some complex types. If you know these types
2914-
statically, you can use ``TypeBuilder<...>::get()``, defined in
2915-
``llvm/Support/TypeBuilder.h``, to retrieve them. ``TypeBuilder`` has two forms
2916-
depending on whether you're building types for cross-compilation or native
2917-
library use. ``TypeBuilder<T, true>`` requires that ``T`` be independent of the
2918-
host environment, meaning that it's built out of types from the ``llvm::types``
2919-
(`doxygen <http://llvm.org/doxygen/namespacellvm_1_1types.html>`__) namespace
2920-
and pointers, functions, arrays, etc. built of those. ``TypeBuilder<T, false>``
2921-
additionally allows native C types whose size may depend on the host compiler.
2922-
For example,
2923-
2924-
.. code-block:: c++
2925-
2926-
FunctionType *ft = TypeBuilder<types::i<8>(types::i<32>*), true>::get();
2927-
2928-
is easier to read and write than the equivalent
2929-
2930-
.. code-block:: c++
2931-
2932-
std::vector<const Type*> params;
2933-
params.push_back(PointerType::getUnqual(Type::Int32Ty));
2934-
FunctionType *ft = FunctionType::get(Type::Int8Ty, params, false);
2935-
2936-
See the `class comment
2937-
<http://llvm.org/doxygen/TypeBuilder_8h_source.html#l00001>`_ for more details.
2938-
29392908
.. _threading:
29402909

29412910
Threads and LLVM

0 commit comments

Comments
 (0)