Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] Fix flag parsing bugs. #84706

Merged
merged 1 commit into from
Mar 11, 2024
Merged

[libc] Fix flag parsing bugs. #84706

merged 1 commit into from
Mar 11, 2024

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Mar 11, 2024

No description provided.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 11, 2024

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/84706.diff

2 Files Affected:

  • (modified) libc/cmake/modules/LLVMLibCCompileOptionRules.cmake (+3-3)
  • (modified) libc/cmake/modules/LLVMLibCFlagRules.cmake (+2-2)
diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index 72b04822d8b84a..893a807b5b61c7 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -2,10 +2,10 @@ function(_get_compile_options_from_flags output_var)
   set(compile_options "")
 
   if(LIBC_TARGET_ARCHITECTURE_IS_RISCV64 OR(LIBC_CPU_FEATURES MATCHES "FMA"))
-    check_flag(ADD_FMA_FLAG ${FMA_OPT_FLAG} ${flags})
+    check_flag(ADD_FMA_FLAG ${FMA_OPT_FLAG} ${ARGN})
   endif()
-  check_flag(ADD_SSE4_2_FLAG ${ROUND_OPT_FLAG} ${flags})
-  check_flag(ADD_EXPLICIT_SIMD_OPT_FLAG ${EXPLICIT_SIMD_OPT_FLAG} ${flags})
+  check_flag(ADD_SSE4_2_FLAG ${ROUND_OPT_FLAG} ${ARGN})
+  check_flag(ADD_EXPLICIT_SIMD_OPT_FLAG ${EXPLICIT_SIMD_OPT_FLAG} ${ARGN})
 
   if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
     if(ADD_FMA_FLAG)
diff --git a/libc/cmake/modules/LLVMLibCFlagRules.cmake b/libc/cmake/modules/LLVMLibCFlagRules.cmake
index 9bec716516f288..18e36dfde5cc19 100644
--- a/libc/cmake/modules/LLVMLibCFlagRules.cmake
+++ b/libc/cmake/modules/LLVMLibCFlagRules.cmake
@@ -131,9 +131,9 @@ endfunction(get_fq_dep_list_without_flag)
 
 # Check if a `flag` is set
 function(check_flag result flag_name)
-  list(FIND ARGN ${flag_name}_FLAG has_flag)
+  list(FIND ARGN ${flag_name} has_flag)
   if(${has_flag} LESS 0)
-    list(FIND ARGN "${flag_name}_FLAG__ONLY" has_flag)
+    list(FIND ARGN "${flag_name}__ONLY" has_flag)
   endif()
   if(${has_flag} GREATER -1)
     set(${result} TRUE PARENT_SCOPE)

@lntue lntue merged commit 6bec4fc into llvm:main Mar 11, 2024
6 checks passed
@lntue lntue deleted the perf branch March 11, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants