[clang] [clang] Increase the default expression nesting limit (PR #104717)

via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 18 11:16:48 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Amr Hesham (AmrDeveloper)

<details>
<summary>Changes</summary>

Increase the default expression nesting limit from 256 to 1024

Fixes: #<!-- -->94728

Compile time with different Bracket depth

Clang version 20.0.0git (https://github.com/AmrDeveloper/llvm-project.git 673b9e08de8a661c9deed2ee497889312f059f3d)
Target: arm64-apple-darwin23.5.0

Bracket depth = 256, time = 0.243
Bracket depth = 512, time = 0.329
Bracket depth = 1024, time = 0.489
Bracket depth = 2048, time = 0.851

---
Full diff: https://github.com/llvm/llvm-project/pull/104717.diff


1 Files Affected:

- (modified) clang/include/clang/Driver/Options.td (+1-1) 


``````````diff
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index cfd9e595c55178..3a0054fdafc638 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -7959,7 +7959,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">, "256">;
+  MarshallingInfoInt<LangOpts<"BracketDepth">, "1024">;
 defm const_strings : BoolOption<"f", "const-strings",
   LangOpts<"ConstStrings">, DefaultFalse,
   PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,

``````````

</details>


https://github.com/llvm/llvm-project/pull/104717


More information about the cfe-commits mailing list