[Lldb-commits] [lldb] r355341 - [build.py] Allow clang-cl to build files starting with '/U'

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 4 13:36:50 PST 2019


Author: xiaobai
Date: Mon Mar  4 13:36:49 2019
New Revision: 355341

URL: http://llvm.org/viewvc/llvm-project?rev=355341&view=rev
Log:
[build.py] Allow clang-cl to build files starting with '/U'

Summary:
clang-cl tries to match cl's interface, and treats /U as "Removes a
predefined macro" as cl does. When you feed clang-cl a file that begins with
'/U' (e.g. /Users/xiaobai/foo.c), clang-cl will emit a warning and in some cases
an error, like so:

clang-9: warning: '/Users/xiaobai/foo.c' treated as the '/U' option [-Wslash-u-filename]
clang-9: note: Use '--' to treat subsequent arguments as filenames
clang-9: error: no input files

If you're using clang-cl, make sure '--' is passed before the source file.

Differential Revision: https://reviews.llvm.org/D58860

Modified:
    lldb/trunk/lit/helper/build.py

Modified: lldb/trunk/lit/helper/build.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/helper/build.py?rev=355341&r1=355340&r2=355341&view=diff
==============================================================================
--- lldb/trunk/lit/helper/build.py (original)
+++ lldb/trunk/lit/helper/build.py Mon Mar  4 13:36:49 2019
@@ -568,6 +568,8 @@ class MsvcBuilder(Builder):
         args.append('/c')
 
         args.append('/Fo' + obj)
+        if self.toolchain_type == 'clang-cl':
+            args.append('--')
         args.append(source)
 
         return ('compiling', [source], obj,




More information about the lldb-commits mailing list