diff options
author | whitequark <whitequark@whitequark.org> | 2018-04-11 22:40:42 +0000 |
---|---|---|
committer | whitequark <whitequark@whitequark.org> | 2018-04-11 22:40:42 +0000 |
commit | 1ae61a612633331ba2bc6a13fc9703de5590fa29 (patch) | |
tree | 149ea6c8dc68e7bf2c5ea3d87711eedab9c77a41 /llvm/include/llvm-c | |
parent | a557852719821f82025fe876607880058799c8af (diff) | |
download | bcm5719-llvm-1ae61a612633331ba2bc6a13fc9703de5590fa29.tar.gz bcm5719-llvm-1ae61a612633331ba2bc6a13fc9703de5590fa29.zip |
[LLVM-C] Add LLVMGetHostCPU{Name,Features}.
Without these functions it's hard to create a TargetMachine for
Orc JIT that creates efficient native code.
It's not sufficient to just expose LLVMGetHostCPUName(), because
for some CPUs there's fewer features actually available than
the CPU name indicates (e.g. AVX might be missing on some CPUs
identified as Skylake).
Differential Revision: https://reviews.llvm.org/D44861
llvm-svn: 329856
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r-- | llvm/include/llvm-c/TargetMachine.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/TargetMachine.h b/llvm/include/llvm-c/TargetMachine.h index f4f7f7698c4..fb0862c226a 100644 --- a/llvm/include/llvm-c/TargetMachine.h +++ b/llvm/include/llvm-c/TargetMachine.h @@ -137,6 +137,14 @@ LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleR disposed with LLVMDisposeMessage. */ char* LLVMGetDefaultTargetTriple(void); +/** Get the host CPU as a string. The result needs to be disposed with + LLVMDisposeMessage. */ +char* LLVMGetHostCPUName(void); + +/** Get the host CPU's features as a string. The result needs to be disposed + with LLVMDisposeMessage. */ +char* LLVMGetHostCPUFeatures(void); + /** Adds the target-specific analysis passes to the pass manager. */ void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM); |