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
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
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits