Skip to content

[LLDB] Pass /std:... before -- on MSVC #141782

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

Merged
merged 1 commit into from
May 30, 2025

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented May 28, 2025

From #140761. MsvcBuilder passed /std:<value> (if specified) after --, so the compiler would interpret this as a file. This moves the argument before the --.

@Nerixyz Nerixyz requested a review from JDevlieghere as a code owner May 28, 2025 14:46
@llvmbot llvmbot added the lldb label May 28, 2025
@llvmbot
Copy link
Member

llvmbot commented May 28, 2025

@llvm/pr-subscribers-lldb

Author: nerix (Nerixyz)

Changes

From #140761. MsvcBuilder passed /std:&lt;value&gt; (if specified) after --, so the compiler would interpret this as a file. This moves the argument before the --.


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

1 Files Affected:

  • (modified) lldb/test/Shell/helper/build.py (+3-3)
diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py
index b2b8146e88c75..caaa14f90af1c 100755
--- a/lldb/test/Shell/helper/build.py
+++ b/lldb/test/Shell/helper/build.py
@@ -683,14 +683,14 @@ def _get_compilation_command(self, source, obj):
             args.append("-fms-compatibility-version=19")
         args.append("/c")
 
+        if self.std:
+            args.append("/std:" + self.std)
+
         args.append("/Fo" + obj)
         if self.toolchain_type == "clang-cl":
             args.append("--")
         args.append(source)
 
-        if self.std:
-            args.append("/std:" + self.std)
-
         return ("compiling", [source], obj, self.compile_env, args)
 
     def _get_link_command(self):

@Michael137 Michael137 merged commit 1b1f498 into llvm:main May 30, 2025
12 checks passed
@Nerixyz Nerixyz deleted the fix/lldb-pass-std-before-dashdash branch May 30, 2025 09:45
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
From llvm#140761. `MsvcBuilder`
passed `/std:<value>` (if specified) after `--`, so the compiler would
interpret this as a file. This moves the argument before the `--`.
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