[compiler-rt] [CompilerRT] Refactor build_invocation function for clarity and conci… (PR #80756)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 14:51:12 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: sp (spqqn)

<details>
<summary>Changes</summary>

…seness

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


1 Files Affected:

- (modified) compiler-rt/test/asan/lit.cfg.py (+4-4) 


``````````diff
diff --git a/compiler-rt/test/asan/lit.cfg.py b/compiler-rt/test/asan/lit.cfg.py
index 83b3cbe789cac..b185f29636116 100644
--- a/compiler-rt/test/asan/lit.cfg.py
+++ b/compiler-rt/test/asan/lit.cfg.py
@@ -102,11 +102,11 @@ def get_required_attr(config, attr_name):
 
 
 def build_invocation(compile_flags, with_lto=False):
-    lto_flags = []
-    if with_lto and config.lto_supported:
-        lto_flags += config.lto_flags
+    lto_flags = config.lto_flags if with_lto and config.lto_supported else []
+
+    invocation = [config.clang] + lto_flags + compile_flags
+    return " ".join(invocation) + " "
 
-    return " " + " ".join([config.clang] + lto_flags + compile_flags) + " "
 
 
 config.substitutions.append(("%clang ", build_invocation(target_cflags)))

``````````

</details>


https://github.com/llvm/llvm-project/pull/80756


More information about the llvm-commits mailing list