diff options
author | dim <dim@FreeBSD.org> | 2013-06-10 20:36:52 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-06-10 20:36:52 +0000 |
commit | aa45f148926e3461a1fd8b10c990f0a51a908cc9 (patch) | |
tree | 909310b2e05119d1d6efda049977042abbb58bb1 /include/llvm/Support/CodeGen.h | |
parent | 169d2bd06003c39970bc94c99669a34b61bb7e45 (diff) | |
download | FreeBSD-src-aa45f148926e3461a1fd8b10c990f0a51a908cc9.zip FreeBSD-src-aa45f148926e3461a1fd8b10c990f0a51a908cc9.tar.gz |
Vendor import of llvm tags/RELEASE_33/final r183502 (effectively, 3.3
release):
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_33/final@183502
Diffstat (limited to 'include/llvm/Support/CodeGen.h')
-rw-r--r-- | include/llvm/Support/CodeGen.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/llvm/Support/CodeGen.h b/include/llvm/Support/CodeGen.h index 1b66c94..240eba6 100644 --- a/include/llvm/Support/CodeGen.h +++ b/include/llvm/Support/CodeGen.h @@ -15,6 +15,9 @@ #ifndef LLVM_SUPPORT_CODEGEN_H #define LLVM_SUPPORT_CODEGEN_H +#include "llvm-c/TargetMachine.h" +#include "llvm/Support/ErrorHandling.h" + namespace llvm { // Relocation model types. @@ -47,6 +50,42 @@ namespace llvm { }; } + // Create wrappers for C Binding types (see CBindingWrapping.h). + inline CodeModel::Model unwrap(LLVMCodeModel Model) { + switch (Model) { + case LLVMCodeModelDefault: + return CodeModel::Default; + case LLVMCodeModelJITDefault: + return CodeModel::JITDefault; + case LLVMCodeModelSmall: + return CodeModel::Small; + case LLVMCodeModelKernel: + return CodeModel::Kernel; + case LLVMCodeModelMedium: + return CodeModel::Medium; + case LLVMCodeModelLarge: + return CodeModel::Large; + } + return CodeModel::Default; + } + + inline LLVMCodeModel wrap(CodeModel::Model Model) { + switch (Model) { + case CodeModel::Default: + return LLVMCodeModelDefault; + case CodeModel::JITDefault: + return LLVMCodeModelJITDefault; + case CodeModel::Small: + return LLVMCodeModelSmall; + case CodeModel::Kernel: + return LLVMCodeModelKernel; + case CodeModel::Medium: + return LLVMCodeModelMedium; + case CodeModel::Large: + return LLVMCodeModelLarge; + } + llvm_unreachable("Bad CodeModel!"); + } } // end llvm namespace #endif |