[llvm] r235417 - Update comment. NFC.
Lang Hames
lhames at gmail.com
Tue Apr 21 14:15:35 PDT 2015
Author: lhames
Date: Tue Apr 21 16:15:35 2015
New Revision: 235417
URL: http://llvm.org/viewvc/llvm-project?rev=235417&view=rev
Log:
Update comment. NFC.
Modified:
llvm/trunk/include/llvm/IR/TypeBuilder.h
Modified: llvm/trunk/include/llvm/IR/TypeBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/TypeBuilder.h?rev=235417&r1=235416&r2=235417&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/TypeBuilder.h (original)
+++ llvm/trunk/include/llvm/IR/TypeBuilder.h Tue Apr 21 16:15:35 2015
@@ -34,6 +34,8 @@ namespace llvm {
/// you'll need to specialize it. For example, say you want to call a
/// function defined externally as:
///
+/// \code{.cpp}
+///
/// struct MyType {
/// int32 a;
/// int32 *b;
@@ -41,12 +43,16 @@ namespace llvm {
/// };
/// int8 AFunction(struct MyType *value);
///
+/// \endcode
+///
/// You'll want to use
/// Function::Create(TypeBuilder<types::i<8>(MyType*), true>::get(), ...)
/// to declare the function, but when you first try this, your compiler will
/// complain that TypeBuilder<MyType, true>::get() doesn't exist. To fix this,
/// write:
///
+/// \code{.cpp}
+///
/// namespace llvm {
/// template<bool xcompile> class TypeBuilder<MyType, xcompile> {
/// public:
@@ -57,7 +63,7 @@ namespace llvm {
/// TypeBuilder<types::i<32>, xcompile>::get(Context),
/// TypeBuilder<types::i<32>*, xcompile>::get(Context),
/// TypeBuilder<types::i<8>*[], xcompile>::get(Context),
-/// NULL);
+/// nullptr);
/// }
///
/// // You may find this a convenient place to put some constants
@@ -71,6 +77,8 @@ namespace llvm {
/// }
/// } // namespace llvm
///
+/// \endcode
+///
/// TypeBuilder cannot handle recursive types or types you only know at runtime.
/// If you try to give it a recursive type, it will deadlock, infinitely
/// recurse, or do something similarly undesirable.
More information about the llvm-commits
mailing list