[PATCH] D73937: [Driver] Change -fmax-tokens $arg to -fmax-tokens=$arg
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 3 17:36:35 PST 2020
MaskRay updated this revision to Diff 242236.
MaskRay added a comment.
Update documentation
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73937/new/
https://reviews.llvm.org/D73937
Files:
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Driver/Options.td
clang/lib/Parse/Parser.cpp
clang/test/Parser/max-tokens.cpp
Index: clang/test/Parser/max-tokens.cpp
===================================================================
--- clang/test/Parser/max-tokens.cpp
+++ clang/test/Parser/max-tokens.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -verify %s -DMAX_TOKENS -fmax-tokens 2
-// RUN: %clang_cc1 -fsyntax-only -verify %s -DMAX_TOKENS_OVERRIDE -fmax-tokens 9
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DMAX_TOKENS -fmax-tokens=2
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DMAX_TOKENS_OVERRIDE -fmax-tokens=9
int x, y, z;
Index: clang/lib/Parse/Parser.cpp
===================================================================
--- clang/lib/Parse/Parser.cpp
+++ clang/lib/Parse/Parser.cpp
@@ -650,7 +650,7 @@
return false;
case tok::eof:
- // Check whether -fmax-tokens was reached.
+ // Check whether -fmax-tokens= was reached.
if (PP.getMaxTokens() != 0 && PP.getTokenCount() > PP.getMaxTokens()) {
PP.Diag(Tok.getLocation(), diag::warn_max_tokens_total)
<< PP.getTokenCount() << PP.getMaxTokens();
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -646,7 +646,7 @@
def interface_stub_version_EQ : JoinedOrSeparate<["-"], "interface-stub-version=">, Flags<[CC1Option]>;
def exported__symbols__list : Separate<["-"], "exported_symbols_list">;
def e : JoinedOrSeparate<["-"], "e">, Group<Link_Group>;
-def fmax_tokens : Separate<["-"], "fmax-tokens">,
+def fmax_tokens : Joined<["-"], "fmax-tokens=">,
HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
Group<f_Group>, Flags<[CC1Option]>;
def fPIC : Flag<["-"], "fPIC">, Group<f_Group>;
Index: clang/include/clang/Basic/DiagnosticGroups.td
===================================================================
--- clang/include/clang/Basic/DiagnosticGroups.td
+++ clang/include/clang/Basic/DiagnosticGroups.td
@@ -1168,14 +1168,14 @@
.. code-block: c++
#pragma clang max_tokens_here 1234
-2. As a per-translation unit limit, using the ``-fmax-tokens`` command-line
+2. As a per-translation unit limit, using the ``-fmax-tokens=`` command-line
flag:
.. code-block: console
- clang -c a.cpp -fmax-tokens 1234
+ clang -c a.cpp -fmax-tokens=1234
3. As a per-translation unit limit using the ``clang max_tokens_total`` pragma,
- which works like and overrides the ``-fmax-tokens`` flag:
+ which works like and overrides the ``-fmax-tokens=`` flag:
.. code-block: c++
#pragma clang max_file_tokens 1234
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73937.242236.patch
Type: text/x-patch
Size: 2681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200204/c0fd62bf/attachment.bin>
More information about the cfe-commits
mailing list