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

[CompilerRT] Refactor build_invocation function for clarity and conci… #80756

Closed
wants to merge 1 commit into from
Closed

[CompilerRT] Refactor build_invocation function for clarity and conci… #80756

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 5, 2024

…seness

Copy link

github-actions bot commented Feb 5, 2024

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 5, 2024

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

Author: sp (spqqn)

Changes

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

Copy link

github-actions bot commented Feb 5, 2024

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Discourse for more information.

Copy link

github-actions bot commented Feb 5, 2024

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r a7bc9cb6ffa91ff0ebabc45c0c7263c7c2c3a4de...be385f2b4634eb9371767252b16b0fb13c05039e compiler-rt/test/asan/lit.cfg.py
View the diff from darker here.
--- lit.cfg.py	2024-02-05 22:50:10.000000 +0000
+++ lit.cfg.py	2024-02-05 22:52:47.966088 +0000
@@ -106,11 +106,10 @@
 
     invocation = [config.clang] + lto_flags + compile_flags
     return " ".join(invocation) + " "
 
 
-
 config.substitutions.append(("%clang ", build_invocation(target_cflags)))
 config.substitutions.append(("%clangxx ", build_invocation(target_cxxflags)))
 config.substitutions.append(("%clang_asan ", build_invocation(clang_asan_cflags)))
 config.substitutions.append(("%clangxx_asan ", build_invocation(clang_asan_cxxflags)))
 config.substitutions.append(

@ghost ghost closed this Feb 5, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant