[PATCH] D13426: Move types in the LLVM C API from Core to Support

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 22:24:22 PST 2015


Amaury SECHET via llvm-commits <llvm-commits at lists.llvm.org> writes:
> Becuase these type were on Core, it required core to be included all
> over the place, notably in IR/Value.h and IR/Type.h . As a result, any
> change in Core.h require to recompile LLVM almost completely, which is
> painful.
>
> Moving them to Support.h allow for most of LLVM to not depend on
> Core.h, saving a lot of compilation time.
>
> There is no functionality change, only reorganisation of header to
> save compilation time.

This looks basically okay. I have some comments on the comments below,
and this should include an update to the release notes about the change
in header organization.

Amaury SECHET <deadalnix+llvmreview at gmail.com> writes:
> deadalnix updated this revision to Diff 38680.
> deadalnix added a comment.
>
> Rebase and fix the Orc C API test case.
>
> Index: unittests/Linker/LinkModulesTest.cpp
> ===================================================================
> --- unittests/Linker/LinkModulesTest.cpp
> +++ unittests/Linker/LinkModulesTest.cpp
> @@ -16,6 +16,7 @@
>  #include "llvm/IR/Module.h"
>  #include "llvm/Linker/Linker.h"
>  #include "llvm/Support/SourceMgr.h"
> +#include "llvm-c/Core.h"
>  #include "llvm-c/Linker.h"
>  #include "gtest/gtest.h"
>  
> Index: unittests/IR/ConstantsTest.cpp
> ===================================================================
> --- unittests/IR/ConstantsTest.cpp
> +++ unittests/IR/ConstantsTest.cpp
> @@ -15,6 +15,7 @@
>  #include "llvm/IR/LLVMContext.h"
>  #include "llvm/IR/Module.h"
>  #include "llvm/Support/SourceMgr.h"
> +#include "llvm-c/Core.h"
>  #include "gtest/gtest.h"
>  
>  namespace llvm {
> Index: unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
> ===================================================================
> --- unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
> +++ unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
> @@ -9,6 +9,7 @@
>  
>  #include "OrcTestCommon.h"
>  #include "gtest/gtest.h"
> +#include "llvm-c/Core.h"
>  #include "llvm-c/OrcBindings.h"
>  #include "llvm-c/Target.h"
>  #include "llvm-c/TargetMachine.h"
> Index: tools/llvm-c-test/object.c
> ===================================================================
> --- tools/llvm-c-test/object.c
> +++ tools/llvm-c-test/object.c
> @@ -13,6 +13,7 @@
>  \*===----------------------------------------------------------------------===*/
>  
>  #include "llvm-c-test.h"
> +#include "llvm-c/Core.h"
>  #include "llvm-c/Object.h"
>  #include <stdio.h>
>  #include <stdlib.h>
> Index: lib/Support/PrettyStackTrace.cpp
> ===================================================================
> --- lib/Support/PrettyStackTrace.cpp
> +++ lib/Support/PrettyStackTrace.cpp
> @@ -13,7 +13,7 @@
>  //===----------------------------------------------------------------------===//
>  
>  #include "llvm/Support/PrettyStackTrace.h"
> -#include "llvm-c/Core.h"
> +#include "llvm-c/ErrorHandling.h"
>  #include "llvm/ADT/SmallString.h"
>  #include "llvm/Config/config.h"     // Get autoconf configuration settings
>  #include "llvm/Support/Compiler.h"
> Index: lib/Support/ErrorHandling.cpp
> ===================================================================
> --- lib/Support/ErrorHandling.cpp
> +++ lib/Support/ErrorHandling.cpp
> @@ -13,7 +13,7 @@
>  //===----------------------------------------------------------------------===//
>  
>  #include "llvm/Support/ErrorHandling.h"
> -#include "llvm-c/Core.h"
> +#include "llvm-c/ErrorHandling.h"
>  #include "llvm/ADT/SmallVector.h"
>  #include "llvm/ADT/Twine.h"
>  #include "llvm/Config/config.h"
> Index: lib/Bitcode/Reader/BitReader.cpp
> ===================================================================
> --- lib/Bitcode/Reader/BitReader.cpp
> +++ lib/Bitcode/Reader/BitReader.cpp
> @@ -8,6 +8,7 @@
>  //===----------------------------------------------------------------------===//
>  
>  #include "llvm-c/BitReader.h"
> +#include "llvm-c/Core.h"
>  #include "llvm/Bitcode/ReaderWriter.h"
>  #include "llvm/IR/DiagnosticPrinter.h"
>  #include "llvm/IR/LLVMContext.h"
> Index: include/llvm/Support/MemoryBuffer.h
> ===================================================================
> --- include/llvm/Support/MemoryBuffer.h
> +++ include/llvm/Support/MemoryBuffer.h
> @@ -14,7 +14,6 @@
>  #ifndef LLVM_SUPPORT_MEMORYBUFFER_H
>  #define LLVM_SUPPORT_MEMORYBUFFER_H
>  
> -#include "llvm-c/Support.h"
>  #include "llvm/ADT/Twine.h"
>  #include "llvm/Support/CBindingWrapping.h"
>  #include "llvm/Support/DataTypes.h"
> Index: include/llvm/Support/CBindingWrapping.h
> ===================================================================
> --- include/llvm/Support/CBindingWrapping.h
> +++ include/llvm/Support/CBindingWrapping.h
> @@ -15,6 +15,7 @@
>  #define LLVM_SUPPORT_CBINDINGWRAPPING_H
>  
>  #include "llvm/Support/Casting.h"
> +#include "llvm-c/Types.h"
>  
>  #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)     \
>    inline ty *unwrap(ref P) {                            \
> Index: include/llvm/PassRegistry.h
> ===================================================================
> --- include/llvm/PassRegistry.h
> +++ include/llvm/PassRegistry.h
> @@ -17,7 +17,6 @@
>  #ifndef LLVM_PASSREGISTRY_H
>  #define LLVM_PASSREGISTRY_H
>  
> -#include "llvm-c/Core.h"
>  #include "llvm/ADT/DenseMap.h"
>  #include "llvm/ADT/SmallPtrSet.h"
>  #include "llvm/ADT/StringMap.h"
> Index: include/llvm/IR/Value.h
> ===================================================================
> --- include/llvm/IR/Value.h
> +++ include/llvm/IR/Value.h
> @@ -14,7 +14,6 @@
>  #ifndef LLVM_IR_VALUE_H
>  #define LLVM_IR_VALUE_H
>  
> -#include "llvm-c/Core.h"
>  #include "llvm/ADT/iterator_range.h"
>  #include "llvm/IR/Use.h"
>  #include "llvm/Support/CBindingWrapping.h"
> Index: include/llvm/IR/Use.h
> ===================================================================
> --- include/llvm/IR/Use.h
> +++ include/llvm/IR/Use.h
> @@ -25,7 +25,6 @@
>  #ifndef LLVM_IR_USE_H
>  #define LLVM_IR_USE_H
>  
> -#include "llvm-c/Core.h"
>  #include "llvm/ADT/PointerIntPair.h"
>  #include "llvm/Support/CBindingWrapping.h"
>  #include "llvm/Support/Compiler.h"
> Index: include/llvm/IR/Type.h
> ===================================================================
> --- include/llvm/IR/Type.h
> +++ include/llvm/IR/Type.h
> @@ -15,7 +15,6 @@
>  #ifndef LLVM_IR_TYPE_H
>  #define LLVM_IR_TYPE_H
>  
> -#include "llvm-c/Core.h"
>  #include "llvm/ADT/APFloat.h"
>  #include "llvm/ADT/SmallPtrSet.h"
>  #include "llvm/Support/CBindingWrapping.h"
> Index: include/llvm/IR/LLVMContext.h
> ===================================================================
> --- include/llvm/IR/LLVMContext.h
> +++ include/llvm/IR/LLVMContext.h
> @@ -15,7 +15,6 @@
>  #ifndef LLVM_IR_LLVMCONTEXT_H
>  #define LLVM_IR_LLVMCONTEXT_H
>  
> -#include "llvm-c/Core.h"
>  #include "llvm/Support/CBindingWrapping.h"
>  #include "llvm/Support/Compiler.h"
>  #include "llvm/Support/Options.h"
> Index: include/llvm/IR/DiagnosticInfo.h
> ===================================================================
> --- include/llvm/IR/DiagnosticInfo.h
> +++ include/llvm/IR/DiagnosticInfo.h
> @@ -15,7 +15,6 @@
>  #ifndef LLVM_IR_DIAGNOSTICINFO_H
>  #define LLVM_IR_DIAGNOSTICINFO_H
>  
> -#include "llvm-c/Core.h"
>  #include "llvm/ADT/ArrayRef.h"
>  #include "llvm/IR/DebugLoc.h"
>  #include "llvm/IR/Module.h"
> Index: include/llvm-c/Types.h
> ===================================================================
> --- /dev/null
> +++ include/llvm-c/Types.h
> @@ -0,0 +1,124 @@
> +/*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\
                  ^~~~~~~~~
Looks like you forgot to updte the comment here.

> +|*                                                                            *|
> +|*                     The LLVM Compiler Infrastructure                       *|
> +|*                                                                            *|
> +|* This file is distributed under the University of Illinois Open Source      *|
> +|* License. See LICENSE.TXT for details.                                      *|
> +|*                                                                            *|
> +|*===----------------------------------------------------------------------===*|
> +|*                                                                            *|
> +|* This file defines the C interface to the LLVM support library.             *|

.. and here. Please change this to explain what *this* file is for.

> +|*                                                                            *|
> +\*===----------------------------------------------------------------------===*/
> +
> +#ifndef LLVM_C_TYPES_H
> +#define LLVM_C_TYPES_H
> +
> +#include "llvm/Support/DataTypes.h"
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/**
> + * @defgroup LLVMCSupportTypes Types and Enumerations
> + *
> + * @{
> + */
> +
> +typedef int LLVMBool;
> +
> +/* Opaque types. */
> +
> +/**
> + * LLVM uses a polymorphic type hierarchy which C cannot represent, therefore
> + * parameters must be passed as base types. Despite the declared types, most
> + * of the functions provided operate only on branches of the type hierarchy.
> + * The declared parameter names are descriptive and specify which type is
> + * required. Additionally, each type hierarchy is documented along with the
> + * functions that operate upon it. For more detail, refer to LLVM's C++ code.
> + * If in doubt, refer to Core.cpp, which performs parameter downcasts in the
> + * form unwrap<RequiredType>(Param).
> + */
> +
> +/**
> + * Used to pass regions of memory through LLVM interfaces.
> + *
> + * @see llvm::MemoryBuffer
> + */
> +typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
> +
> +/**
> + * The top-level container for all LLVM global data. See the LLVMContext class.
> + */
> +typedef struct LLVMOpaqueContext *LLVMContextRef;
> +
> +/**
> + * The top-level container for all other LLVM Intermediate Representation (IR)
> + * objects.
> + *
> + * @see llvm::Module
> + */
> +typedef struct LLVMOpaqueModule *LLVMModuleRef;
> +
> +/**
> + * Each value in the LLVM IR has a type, an LLVMTypeRef.
> + *
> + * @see llvm::Type
> + */
> +typedef struct LLVMOpaqueType *LLVMTypeRef;
> +
> +/**
> + * Represents an individual value in LLVM IR.
> + *
> + * This models llvm::Value.
> + */
> +typedef struct LLVMOpaqueValue *LLVMValueRef;
> +
> +/**
> + * Represents a basic block of instructions in LLVM IR.
> + *
> + * This models llvm::BasicBlock.
> + */
> +typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
> +
> +/**
> + * Represents an LLVM basic block builder.
> + *
> + * This models llvm::IRBuilder.
> + */
> +typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
> +
> +/**
> + * Interface used to provide a module to JIT or interpreter.
> + * This is now just a synonym for llvm::Module, but we have to keep using the
> + * different type to keep binary compatibility.
> + */
> +typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
> +
> +/** @see llvm::PassManagerBase */
> +typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
> +
> +/** @see llvm::PassRegistry */
> +typedef struct LLVMOpaquePassRegistry *LLVMPassRegistryRef;
> +
> +/**
> + * Used to get the users and usees of a Value.
> + *
> + * @see llvm::Use */
> +typedef struct LLVMOpaqueUse *LLVMUseRef;
> +
> +/**
> + * @see llvm::DiagnosticInfo
> + */
> +typedef struct LLVMOpaqueDiagnosticInfo *LLVMDiagnosticInfoRef;
> +
> +/**
> + * @}
> + */
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif
> Index: include/llvm-c/Transforms/Vectorize.h
> ===================================================================
> --- include/llvm-c/Transforms/Vectorize.h
> +++ include/llvm-c/Transforms/Vectorize.h
> @@ -20,7 +20,7 @@
>  #ifndef LLVM_C_TRANSFORMS_VECTORIZE_H
>  #define LLVM_C_TRANSFORMS_VECTORIZE_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> @@ -51,4 +51,3 @@
>  #endif /* defined(__cplusplus) */
>  
>  #endif
> -
> Index: include/llvm-c/Transforms/Scalar.h
> ===================================================================
> --- include/llvm-c/Transforms/Scalar.h
> +++ include/llvm-c/Transforms/Scalar.h
> @@ -19,7 +19,7 @@
>  #ifndef LLVM_C_TRANSFORMS_SCALAR_H
>  #define LLVM_C_TRANSFORMS_SCALAR_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> Index: include/llvm-c/Transforms/PassManagerBuilder.h
> ===================================================================
> --- include/llvm-c/Transforms/PassManagerBuilder.h
> +++ include/llvm-c/Transforms/PassManagerBuilder.h
> @@ -14,7 +14,7 @@
>  #ifndef LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H
>  #define LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  typedef struct LLVMOpaquePassManagerBuilder *LLVMPassManagerBuilderRef;
>  
> Index: include/llvm-c/Transforms/IPO.h
> ===================================================================
> --- include/llvm-c/Transforms/IPO.h
> +++ include/llvm-c/Transforms/IPO.h
> @@ -15,7 +15,7 @@
>  #ifndef LLVM_C_TRANSFORMS_IPO_H
>  #define LLVM_C_TRANSFORMS_IPO_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> Index: include/llvm-c/TargetMachine.h
> ===================================================================
> --- include/llvm-c/TargetMachine.h
> +++ include/llvm-c/TargetMachine.h
> @@ -19,7 +19,7 @@
>  #ifndef LLVM_C_TARGETMACHINE_H
>  #define LLVM_C_TARGETMACHINE_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  #include "llvm-c/Target.h"
>  
>  #ifdef __cplusplus
> Index: include/llvm-c/Target.h
> ===================================================================
> --- include/llvm-c/Target.h
> +++ include/llvm-c/Target.h
> @@ -19,7 +19,7 @@
>  #ifndef LLVM_C_TARGET_H
>  #define LLVM_C_TARGET_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  #include "llvm/Config/llvm-config.h"
>  
>  #if defined(_MSC_VER) && !defined(inline)
> Index: include/llvm-c/Support.h
> ===================================================================
> --- include/llvm-c/Support.h
> +++ include/llvm-c/Support.h
> @@ -15,31 +15,13 @@
>  #define LLVM_C_SUPPORT_H
>  
>  #include "llvm/Support/DataTypes.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
>  
>  /**
> - * @defgroup LLVMCSupportTypes Types and Enumerations
> - *
> - * @{
> - */
> -
> -typedef int LLVMBool;
> -
> -/**
> - * Used to pass regions of memory through LLVM interfaces.
> - *
> - * @see llvm::MemoryBuffer
> - */
> -typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
> -
> -/**
> - * @}
> - */
> -
> -/**
>   * This function permanently loads the dynamic library at the given path.
>   * It is safe to call this function multiple times for the same library.
>   *
> Index: include/llvm-c/Object.h
> ===================================================================
> --- include/llvm-c/Object.h
> +++ include/llvm-c/Object.h
> @@ -19,7 +19,7 @@
>  #ifndef LLVM_C_OBJECT_H
>  #define LLVM_C_OBJECT_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  #include "llvm/Config/llvm-config.h"
>  
>  #ifdef __cplusplus
> Index: include/llvm-c/Linker.h
> ===================================================================
> --- include/llvm-c/Linker.h
> +++ include/llvm-c/Linker.h
> @@ -14,7 +14,7 @@
>  #ifndef LLVM_C_LINKER_H
>  #define LLVM_C_LINKER_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> Index: include/llvm-c/Initialization.h
> ===================================================================
> --- include/llvm-c/Initialization.h
> +++ include/llvm-c/Initialization.h
> @@ -16,7 +16,7 @@
>  #ifndef LLVM_C_INITIALIZATION_H
>  #define LLVM_C_INITIALIZATION_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> Index: include/llvm-c/IRReader.h
> ===================================================================
> --- include/llvm-c/IRReader.h
> +++ include/llvm-c/IRReader.h
> @@ -14,7 +14,7 @@
>  #ifndef LLVM_C_IRREADER_H
>  #define LLVM_C_IRREADER_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> Index: include/llvm-c/ExecutionEngine.h
> ===================================================================
> --- include/llvm-c/ExecutionEngine.h
> +++ include/llvm-c/ExecutionEngine.h
> @@ -19,7 +19,7 @@
>  #ifndef LLVM_C_EXECUTIONENGINE_H
>  #define LLVM_C_EXECUTIONENGINE_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  #include "llvm-c/Target.h"
>  #include "llvm-c/TargetMachine.h"
>  
> Index: include/llvm-c/ErrorHandling.h
> ===================================================================
> --- /dev/null
> +++ include/llvm-c/ErrorHandling.h
> @@ -0,0 +1,51 @@
> +/*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\

This header is also wrong.

> +|*                                                                            *|
> +|*                     The LLVM Compiler Infrastructure                       *|
> +|*                                                                            *|
> +|* This file is distributed under the University of Illinois Open Source      *|
> +|* License. See LICENSE.TXT for details.                                      *|
> +|*                                                                            *|
> +|*===----------------------------------------------------------------------===*|
> +|*                                                                            *|
> +|* This file defines the C interface to the LLVM support library.             *|

And here.

> +|*                                                                            *|
> +\*===----------------------------------------------------------------------===*/
> +
> +#ifndef LLVM_C_ERROR_HANDLING_H
> +#define LLVM_C_ERROR_HANDLING_H
> +
> +#include "llvm-c/Types.h"
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +typedef void (*LLVMFatalErrorHandler)(const char *Reason);
> +
> +/**
> + * Install a fatal error handler. By default, if LLVM detects a fatal error, it
> + * will call exit(1). This may not be appropriate in many contexts. For example,
> + * doing exit(1) will bypass many crash reporting/tracing system tools. This
> + * function allows you to install a callback that will be invoked prior to the
> + * call to exit(1).
> + */
> +void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);
> +
> +/**
> + * Reset the fatal error handler. This resets LLVM's fatal error handling
> + * behavior to the default.
> + */
> +void LLVMResetFatalErrorHandler(void);
> +
> +/**
> + * Enable LLVM's built-in stack trace code. This intercepts the OS's crash
> + * signals and prints which component of LLVM you were in at the time if the
> + * crash.
> + */
> +void LLVMEnablePrettyStackTrace(void);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif
> Index: include/llvm-c/Core.h
> ===================================================================
> --- include/llvm-c/Core.h
> +++ include/llvm-c/Core.h
> @@ -15,7 +15,7 @@
>  #ifndef LLVM_C_CORE_H
>  #define LLVM_C_CORE_H
>  
> -#include "llvm-c/Support.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> @@ -40,15 +40,6 @@
>   * the LLVM intermediate representation as well as other related types
>   * and utilities.
>   *
> - * LLVM uses a polymorphic type hierarchy which C cannot represent, therefore
> - * parameters must be passed as base types. Despite the declared types, most
> - * of the functions provided operate only on branches of the type hierarchy.
> - * The declared parameter names are descriptive and specify which type is
> - * required. Additionally, each type hierarchy is documented along with the
> - * functions that operate upon it. For more detail, refer to LLVM's C++ code.
> - * If in doubt, refer to Core.cpp, which performs parameter downcasts in the
> - * form unwrap<RequiredType>(Param).

I'm not sure what it all looks like in the doxygen output, but I think
that this comment or at least a note to the same effect with a pointer
to the detailed info really does belong here.

> - *
>   * Many exotic languages can interoperate with C code but have a harder time
>   * with C++ due to name mangling. So in addition to C, this interface enables
>   * tools written in such languages.
> @@ -62,74 +53,6 @@
>   * @{
>   */
>  
> -/* Opaque types. */
> -
> -/**
> - * The top-level container for all LLVM global data. See the LLVMContext class.
> - */
> -typedef struct LLVMOpaqueContext *LLVMContextRef;
> -
> -/**
> - * The top-level container for all other LLVM Intermediate Representation (IR)
> - * objects.
> - *
> - * @see llvm::Module
> - */
> -typedef struct LLVMOpaqueModule *LLVMModuleRef;
> -
> -/**
> - * Each value in the LLVM IR has a type, an LLVMTypeRef.
> - *
> - * @see llvm::Type
> - */
> -typedef struct LLVMOpaqueType *LLVMTypeRef;
> -
> -/**
> - * Represents an individual value in LLVM IR.
> - *
> - * This models llvm::Value.
> - */
> -typedef struct LLVMOpaqueValue *LLVMValueRef;
> -
> -/**
> - * Represents a basic block of instructions in LLVM IR.
> - *
> - * This models llvm::BasicBlock.
> - */
> -typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
> -
> -/**
> - * Represents an LLVM basic block builder.
> - *
> - * This models llvm::IRBuilder.
> - */
> -typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
> -
> -/**
> - * Interface used to provide a module to JIT or interpreter.
> - * This is now just a synonym for llvm::Module, but we have to keep using the
> - * different type to keep binary compatibility.
> - */
> -typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
> -
> -/** @see llvm::PassManagerBase */
> -typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
> -
> -/** @see llvm::PassRegistry */
> -typedef struct LLVMOpaquePassRegistry *LLVMPassRegistryRef;
> -
> -/**
> - * Used to get the users and usees of a Value.
> - *
> - * @see llvm::Use */
> -typedef struct LLVMOpaqueUse *LLVMUseRef;
> -
> -
> -/**
> - * @see llvm::DiagnosticInfo
> - */
> -typedef struct LLVMOpaqueDiagnosticInfo *LLVMDiagnosticInfoRef;
> -
>  typedef enum {
>      LLVMZExtAttribute       = 1<<0,
>      LLVMSExtAttribute       = 1<<1,
> @@ -442,30 +365,6 @@
>  char *LLVMCreateMessage(const char *Message);
>  void LLVMDisposeMessage(char *Message);
>  
> -typedef void (*LLVMFatalErrorHandler)(const char *Reason);
> -
> -/**
> - * Install a fatal error handler. By default, if LLVM detects a fatal error, it
> - * will call exit(1). This may not be appropriate in many contexts. For example,
> - * doing exit(1) will bypass many crash reporting/tracing system tools. This
> - * function allows you to install a callback that will be invoked prior to the
> - * call to exit(1).
> - */
> -void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);
> -
> -/**
> - * Reset the fatal error handler. This resets LLVM's fatal error handling
> - * behavior to the default.
> - */
> -void LLVMResetFatalErrorHandler(void);
> -
> -/**
> - * Enable LLVM's built-in stack trace code. This intercepts the OS's crash
> - * signals and prints which component of LLVM you were in at the time if the
> - * crash.
> - */
> -void LLVMEnablePrettyStackTrace(void);
> -
>  /**
>   * @defgroup LLVMCCoreContext Contexts
>   *
> @@ -2442,7 +2341,7 @@
>   *
>   * @see llvm::Instruction::getOpCode()
>   */
> -LLVMOpcode   LLVMGetInstructionOpcode(LLVMValueRef Inst);
> +LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst);
>  
>  /**
>   * Obtain the predicate of an instruction.
> Index: include/llvm-c/BitWriter.h
> ===================================================================
> --- include/llvm-c/BitWriter.h
> +++ include/llvm-c/BitWriter.h
> @@ -19,7 +19,7 @@
>  #ifndef LLVM_C_BITWRITER_H
>  #define LLVM_C_BITWRITER_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> Index: include/llvm-c/BitReader.h
> ===================================================================
> --- include/llvm-c/BitReader.h
> +++ include/llvm-c/BitReader.h
> @@ -19,7 +19,7 @@
>  #ifndef LLVM_C_BITREADER_H
>  #define LLVM_C_BITREADER_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> Index: include/llvm-c/Analysis.h
> ===================================================================
> --- include/llvm-c/Analysis.h
> +++ include/llvm-c/Analysis.h
> @@ -19,7 +19,7 @@
>  #ifndef LLVM_C_ANALYSIS_H
>  #define LLVM_C_ANALYSIS_H
>  
> -#include "llvm-c/Core.h"
> +#include "llvm-c/Types.h"
>  
>  #ifdef __cplusplus
>  extern "C" {


More information about the llvm-commits mailing list