[clang] 172fcd9 - [clang-cl] Parse the /external: flags (PR36003)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 8 09:00:25 PDT 2021


Author: Hans Wennborg
Date: 2021-06-08T18:00:03+02:00
New Revision: 172fcd9600e13d5365f5cf648105891ff6a0e59d

URL: https://github.com/llvm/llvm-project/commit/172fcd9600e13d5365f5cf648105891ff6a0e59d
DIFF: https://github.com/llvm/llvm-project/commit/172fcd9600e13d5365f5cf648105891ff6a0e59d.diff

LOG: [clang-cl] Parse the /external: flags (PR36003)

They are still unsupported, but at least this makes clang-cl not mistake
them for being filenames.

As pointed out in the bug, VS 16.10 now uses these flags in new projects
by default.

Added: 
    

Modified: 
    clang/include/clang/Driver/Options.td
    clang/test/Driver/cl-options.c

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 9f6225c966b0..bae7426bc64e 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -6209,6 +6209,8 @@ def _SLASH_d2 : CLJoined<"d2">;
 def _SLASH_doc : CLJoined<"doc">;
 def _SLASH_experimental : CLJoined<"experimental:">;
 def _SLASH_exportHeader : CLFlag<"exportHeader">;
+def _SLASH_external : CLJoined<"external:">;
+def _SLASH_external_COLON_I : CLJoinedOrSeparate<"external:I">;
 def _SLASH_FA_joined : CLJoined<"FA">;
 def _SLASH_favor : CLJoined<"favor">;
 def _SLASH_fsanitize_address_use_after_return : CLJoined<"fsanitize-address-use-after-return">;

diff  --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index a9125233940a..f60c2b614702 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -428,9 +428,20 @@
 // RUN:     /clr:pure \
 // RUN:     /d2FH4 \
 // RUN:     /docname \
+// RUN:     /experimental:external \
 // RUN:     /experimental:module \
 // RUN:     /experimental:preprocessor \
 // RUN:     /exportHeader /headerName:foo \
+// RUN:     /external:anglebrackets \
+// RUN:     /external:Ipath \
+// RUN:     /external:I path \
+// RUN:     /external:env:var \
+// RUN:     /external:W0 \
+// RUN:     /external:W1 \
+// RUN:     /external:W2 \
+// RUN:     /external:W3 \
+// RUN:     /external:W4 \
+// RUN:     /external:templates- \
 // RUN:     /headerUnit foo.h=foo.ifc /headerUnit:quote foo.h=foo.ifc /headerUnit:angle foo.h=foo.ifc \
 // RUN:     /EHsc \
 // RUN:     /F 42 \


        


More information about the cfe-commits mailing list