From d90b8b1d653bed11d207472b23e80dd66ad3be29 Mon Sep 17 00:00:00 2001 From: Dwight Guth Date: Thu, 11 Jul 2024 12:02:30 -0500 Subject: [PATCH] fix llvm-kompile being passed more options conventionally (#4514) This changes the order of flags passed to llvm-kompile in order to ensure that llvm-kompile-codegen will run with the correct optimization flags. Co-authored-by: rv-jenkins --- .../main/java/org/kframework/backend/llvm/LLVMBackend.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMBackend.java b/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMBackend.java index ef6b1d4246c..42df5042047 100644 --- a/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMBackend.java +++ b/llvm-backend/src/main/java/org/kframework/backend/llvm/LLVMBackend.java @@ -143,9 +143,6 @@ private void llvmKompile(String type, String executable) { args.add("--mutable-bytes"); } - // Arguments after this point are passed on to Clang. - args.add("--"); - if (options.debug) { args.add("-g"); args.add("-O1"); @@ -171,6 +168,9 @@ private void llvmKompile(String type, String executable) { args.add("-O2"); // clang -O3 does not make the llvm backend any faster } + // Arguments after this point are passed on to Clang. + args.add("--"); + args.addAll(options.ccopts); if (globalOptions.verbose) {