[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:50:30 PST 2024


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

…seness

>From be385f2b4634eb9371767252b16b0fb13c05039e Mon Sep 17 00:00:00 2001
From: sp <157905693+spqqn at users.noreply.github.com>
Date: Mon, 5 Feb 2024 22:50:10 +0000
Subject: [PATCH] [CompilerRT] Refactor build_invocation function for clarity
 and conciseness

---
 compiler-rt/test/asan/lit.cfg.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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)))



More information about the llvm-commits mailing list