Author: Aaron Ballman
Date: 2024-08-23T09:49:08-04:00
New Revision: e3ce979f1b3ac1e7f2d0261d3abffbd12064eae6

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

LOG: Revert "[clang] Increase the default expression nesting limit (#104717)"

This reverts commit 7597e0930638e0a20ca9bfc193a3d89575ce4469.

It caused several buildbot failures due to stack overflows with the
parser test.

Added: 
    

Modified: 
    clang/docs/ReleaseNotes.rst
    clang/include/clang/Driver/Options.td
    clang/test/Parser/parser_overflow.c

Removed: 
    


################################################################################
diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 93040c2eee2c0b..70ff5dedab217f 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -174,8 +174,6 @@ Deprecated Compiler Flags
 Modified Compiler Flags
 -----------------------
 
-- The compiler flag `-fbracket-depth` default value is increased from 256 to 
2048.
-
 - The ``-ffp-model`` option has been updated to enable a more limited set of
   optimizations when the ``fast`` argument is used and to accept a new 
argument,
   ``aggressive``. The behavior of ``-ffp-model=aggressive`` is equivalent

diff  --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 111608d30ff827..7e40e99e9ba252 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -7976,7 +7976,7 @@ def fapply_global_visibility_to_externs : Flag<["-"], 
"fapply-global-visibility-
   MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
 def fbracket_depth : Separate<["-"], "fbracket-depth">,
   HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
-  MarshallingInfoInt<LangOpts<"BracketDepth">, "2048">;
+  MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
 defm const_strings : BoolOption<"f", "const-strings",
   LangOpts<"ConstStrings">, DefaultFalse,
   PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,

diff  --git a/clang/test/Parser/parser_overflow.c 
b/clang/test/Parser/parser_overflow.c
index 53c79bc06d993d..9514e808550a4b 100644
--- a/clang/test/Parser/parser_overflow.c
+++ b/clang/test/Parser/parser_overflow.c
@@ -1,5 +1,5 @@
 // RUN: not %clang_cc1 %s -fsyntax-only -DHUGE 2>&1 | FileCheck %s
-// RUN: %clang_cc1 %s -fsyntax-only
+// RUN: not %clang_cc1 %s -fsyntax-only 2>&1 | FileCheck %s
 // RUN: not %clang_cc1 %s -fsyntax-only -fbracket-depth 299 2>&1 | FileCheck %s
 // RUN: %clang_cc1 %s -fsyntax-only -fbracket-depth 300
 // RUN: not %clang %s -fsyntax-only -fbracket-depth=299 2>&1 | FileCheck %s
@@ -15,5 +15,5 @@ void foo(void) {
 #endif
 }
 
-// CHECK: fatal error: bracket nesting level exceeded maximum of {{2048|299}}
+// CHECK: fatal error: bracket nesting level exceeded maximum of {{256|299}}
 // CHECK: note: use -fbracket-depth=N to increase maximum nesting level


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to