[llvm] [llvm-c] Improve TargetMachine bindings (PR #70806)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 21:08:52 PDT 2023
================
@@ -175,6 +175,40 @@ void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
unwrap(T)->Options.MCOptions.AsmVerbose = VerboseAsm;
}
+void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable) {
+ unwrap(T)->setFastISel(Enable);
+}
+
+void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable) {
+ unwrap(T)->setGlobalISel(Enable);
+}
+
+void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T,
+ LLVMGlobalISelAbortMode Mode) {
+ GlobalISelAbortMode AM;
+ switch (Mode) {
+ case LLVMGlobalISelAbortDisable:
+ AM = GlobalISelAbortMode::Disable;
+ break;
+ case LLVMGlobalISelAbortEnable:
+ AM = GlobalISelAbortMode::Enable;
+ break;
+ case LLVMGlobalISelAbortDisableWithDiag:
+ AM = GlobalISelAbortMode::DisableWithDiag;
+ break;
+ default:
+ AM = GlobalISelAbortMode::Enable;
----------------
joker-eph wrote:
This triggers a compiler warning:
```
llvm/lib/Target/TargetMachineC.cpp:276:3: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
```
https://github.com/llvm/llvm-project/pull/70806
More information about the llvm-commits
mailing list