diff options
Diffstat (limited to 'include/llvm-c')
-rw-r--r-- | include/llvm-c/Core.h | 21 | ||||
-rw-r--r-- | include/llvm-c/Disassembler.h | 6 | ||||
-rw-r--r-- | include/llvm-c/Linker.h | 42 | ||||
-rw-r--r-- | include/llvm-c/Target.h | 12 |
4 files changed, 66 insertions, 15 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 7774606..0bd5db3 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -21,9 +21,9 @@ /* Need these includes to support the LLVM 'cast' template for the C++ 'wrap' and 'unwrap' conversion functions. */ +#include "llvm/IRBuilder.h" #include "llvm/Module.h" #include "llvm/PassRegistry.h" -#include "llvm/Support/IRBuilder.h" extern "C" { #endif @@ -53,7 +53,7 @@ extern "C" { * 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 paramter downcasts in the + * If in doubt, refer to Core.cpp, which performs parameter downcasts in the * form unwrap<RequiredType>(Param). * * Many exotic languages can interoperate with C code but have a harder time @@ -106,7 +106,7 @@ typedef struct LLVMOpaqueType *LLVMTypeRef; typedef struct LLVMOpaqueValue *LLVMValueRef; /** - * Represents a basic block of instruction in LLVM IR. + * Represents a basic block of instructions in LLVM IR. * * This models llvm::BasicBlock. */ @@ -478,6 +478,15 @@ void LLVMSetTarget(LLVMModuleRef M, const char *Triple); void LLVMDumpModule(LLVMModuleRef M); /** + * Print a representation of a module to a file. The ErrorMessage needs to be + * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise. + * + * @see Module::print() + */ +LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, + char **ErrorMessage); + +/** * Set inline assembly for a module. * * @see Module::setModuleInlineAsm() @@ -977,7 +986,7 @@ LLVMTypeRef LLVMX86MMXType(void); * * LLVMValueRef essentially represents llvm::Value. There is a rich * hierarchy of classes within this type. Depending on the instance - * obtain, not all APIs are available. + * obtained, not all APIs are available. * * Callers can determine the type of a LLVMValueRef by calling the * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These @@ -1153,7 +1162,7 @@ LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLARE_VALUE_CAST) * * Uses are obtained in an iterator fashion. First, call this function * to obtain a reference to the first use. Then, call LLVMGetNextUse() - * on that instance and all subsequently obtained instances untl + * on that instance and all subsequently obtained instances until * LLVMGetNextUse() returns NULL. * * @see llvm::Value::use_begin() @@ -2106,7 +2115,7 @@ LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst); LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst); /** - * Obtain the instruction that occured before this one. + * Obtain the instruction that occurred before this one. * * If the instruction is the first instruction in a basic block, NULL * will be returned. diff --git a/include/llvm-c/Disassembler.h b/include/llvm-c/Disassembler.h index a676e37..69fdc64 100644 --- a/include/llvm-c/Disassembler.h +++ b/include/llvm-c/Disassembler.h @@ -109,9 +109,9 @@ struct LLVMOpInfo1 { */ typedef const char *(*LLVMSymbolLookupCallback)(void *DisInfo, uint64_t ReferenceValue, - uint64_t *ReferenceType, - uint64_t ReferencePC, - const char **ReferenceName); + uint64_t *ReferenceType, + uint64_t ReferencePC, + const char **ReferenceName); /** * The reference types on input and output. */ diff --git a/include/llvm-c/Linker.h b/include/llvm-c/Linker.h new file mode 100644 index 0000000..9f337cf --- /dev/null +++ b/include/llvm-c/Linker.h @@ -0,0 +1,42 @@ +/*===-- llvm-c/Linker.h - Module Linker C Interface -------------*- C++ -*-===*\ +|* *| +|* 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 module/file/archive linker. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_C_LINKER_H +#define LLVM_C_LINKER_H + +#include "llvm-c/Core.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef enum { + LLVMLinkerDestroySource = 0, /* Allow source module to be destroyed. */ + LLVMLinkerPreserveSource = 1 /* Preserve the source module. */ +} LLVMLinkerMode; + + +/* Links the source module into the destination module, taking ownership + * of the source module away from the caller. Optionally returns a + * human-readable description of any errors that occurred in linking. + * OutMessage must be disposed with LLVMDisposeMessage. The return value + * is true if an error occurred, false otherwise. */ +LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src, + LLVMLinkerMode Mode, char **OutMessage); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/llvm-c/Target.h b/include/llvm-c/Target.h index 568e60d..8915040 100644 --- a/include/llvm-c/Target.h +++ b/include/llvm-c/Target.h @@ -56,19 +56,19 @@ typedef struct LLVMStructLayout *LLVMStructLayoutRef; /* Declare all of the available assembly printer initialization functions. */ #define LLVM_ASM_PRINTER(TargetName) \ - void LLVMInitialize##TargetName##AsmPrinter(); + void LLVMInitialize##TargetName##AsmPrinter(void); #include "llvm/Config/AsmPrinters.def" #undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ /* Declare all of the available assembly parser initialization functions. */ #define LLVM_ASM_PARSER(TargetName) \ - void LLVMInitialize##TargetName##AsmParser(); + void LLVMInitialize##TargetName##AsmParser(void); #include "llvm/Config/AsmParsers.def" #undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ /* Declare all of the available disassembler initialization functions. */ #define LLVM_DISASSEMBLER(TargetName) \ - void LLVMInitialize##TargetName##Disassembler(); + void LLVMInitialize##TargetName##Disassembler(void); #include "llvm/Config/Disassemblers.def" #undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ @@ -102,7 +102,7 @@ static inline void LLVMInitializeAllTargetMCs(void) { /** LLVMInitializeAllAsmPrinters - The main program should call this function if it wants all asm printers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllAsmPrinters() { +static inline void LLVMInitializeAllAsmPrinters(void) { #define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter(); #include "llvm/Config/AsmPrinters.def" #undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ @@ -111,7 +111,7 @@ static inline void LLVMInitializeAllAsmPrinters() { /** LLVMInitializeAllAsmParsers - The main program should call this function if it wants all asm parsers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllAsmParsers() { +static inline void LLVMInitializeAllAsmParsers(void) { #define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser(); #include "llvm/Config/AsmParsers.def" #undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ @@ -120,7 +120,7 @@ static inline void LLVMInitializeAllAsmParsers() { /** LLVMInitializeAllDisassemblers - The main program should call this function if it wants all disassemblers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllDisassemblers() { +static inline void LLVMInitializeAllDisassemblers(void) { #define LLVM_DISASSEMBLER(TargetName) \ LLVMInitialize##TargetName##Disassembler(); #include "llvm/Config/Disassemblers.def" |