[PATCH] Move the -i[no-]system-prefix options from CC1Options.td to Options.td.

Alexander Kornienko alexfh at google.com
Tue Mar 25 17:08:51 PDT 2014


  Allow separate form without '=' and joined form with '='.

Hi rsmith,

http://llvm-reviews.chandlerc.com/D3185

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D3185?vs=8114&id=8119#toc

Files:
  docs/UsersManual.rst
  include/clang/Driver/CC1Options.td
  include/clang/Driver/Options.td
  test/Frontend/system-header-prefix.c

Index: docs/UsersManual.rst
===================================================================
--- docs/UsersManual.rst
+++ docs/UsersManual.rst
@@ -700,7 +700,7 @@
 
   char b = 'ab'; // no warning
 
-The :option:`-isystem-prefix` and :option:`-ino-system-prefix` command-line
+The :option:`-isystem-prefix=` and :option:`-ino-system-prefix=` command-line
 arguments can be used to override whether subsets of an include path are
 treated as system headers. When the name in a ``#include`` directive is
 found within a header search path and starts with a system prefix, the
@@ -710,7 +710,7 @@
 
 .. code-block:: console
 
-  $ clang -Ifoo -isystem bar -isystem-prefix x/ -ino-system-prefix x/y/
+  $ clang -Ifoo -isystem bar -isystem-prefix=x/ -ino-system-prefix=x/y/
 
 Here, ``#include "x/a.h"`` is treated as including a system header, even
 if the header is found in ``foo``, and ``#include "x/y/b.h"`` is treated
Index: include/clang/Driver/CC1Options.td
===================================================================
--- include/clang/Driver/CC1Options.td
+++ include/clang/Driver/CC1Options.td
@@ -508,14 +508,6 @@
            "implicit extern \"C\" semantics; these are assumed to not be "
            "user-provided and are used to model system and standard headers' "
            "paths.">;
-def isystem_prefix : JoinedOrSeparate<["-"], "isystem-prefix">,
-  MetaVarName<"<prefix>">,
-  HelpText<"Treat all #include paths starting with <prefix> as including a "
-           "system header.">;
-def ino_system_prefix : JoinedOrSeparate<["-"], "ino-system-prefix">,
-  MetaVarName<"<prefix>">,
-  HelpText<"Treat all #include paths starting with <prefix> as not including a "
-           "system header.">;
 
 //===----------------------------------------------------------------------===//
 // Preprocessor Options
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -961,6 +961,16 @@
   HelpText<"Set the system root directory (usually /)">, MetaVarName<"<dir>">;
 def isystem : JoinedOrSeparate<["-"], "isystem">, Group<clang_i_Group>, Flags<[CC1Option]>,
   HelpText<"Add directory to SYSTEM include search path">, MetaVarName<"<directory>">;
+def isystem_prefix : Separate<["-"], "isystem-prefix">,
+  Group<clang_i_Group>, Flags<[CC1Option]>, MetaVarName<"<prefix>">,
+  HelpText<"Treat all #include paths starting with <prefix> as including a "
+           "system header.">;
+def : Joined<["-"], "isystem-prefix=">, Alias<isystem_prefix>;
+def ino_system_prefix : Separate<["-"], "ino-system-prefix">,
+  Group<clang_i_Group>, Flags<[CC1Option]>, MetaVarName<"<prefix>">,
+  HelpText<"Treat all #include paths starting with <prefix> as not including a "
+           "system header.">;
+def : Joined<["-"], "ino-system-prefix=">, Alias<ino_system_prefix>;
 def iwithprefixbefore : JoinedOrSeparate<["-"], "iwithprefixbefore">, Group<clang_i_Group>,
   HelpText<"Set directory to include search path with prefix">, MetaVarName<"<dir>">,
   Flags<[CC1Option]>;
Index: test/Frontend/system-header-prefix.c
===================================================================
--- test/Frontend/system-header-prefix.c
+++ test/Frontend/system-header-prefix.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -isystem-prefix libs/ -ino-system-prefix libs/mylib/ -I%S/Inputs/SystemHeaderPrefix -Wundef -E %s 2>&1 | FileCheck %s
+// RUN: %clang -isystem-prefix libs/ -ino-system-prefix libs/mylib/ -I%S/Inputs/SystemHeaderPrefix -Wundef -E %s 2>&1 | FileCheck %s
+// RUN: %clang -isystem-prefix=libs/ -ino-system-prefix=libs/mylib/ -I%S/Inputs/SystemHeaderPrefix -Wundef -E %s 2>&1 | FileCheck %s
 
 #include "src/all.h"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3185.4.patch
Type: text/x-patch
Size: 3755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140325/13a3dc7e/attachment.bin>


More information about the cfe-commits mailing list