Respect clang's default -fbracket-depth by default

Set default value of --comp-limit-parens to 240, to respect default
 maximum nesting of parentheses in clang (which is controlled by
 -fbracket-depth and defaults to 256). For code generation consistency,
 also use the same default with gcc.
This commit is contained in:
Geza Lore 2022-07-25 12:59:26 +01:00
parent 290c2e0388
commit ac4ec87942
2 changed files with 3 additions and 3 deletions

View File

@ -1010,11 +1010,11 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
if (!strcmp(valp, "clang")) { if (!strcmp(valp, "clang")) {
m_compLimitBlocks = 80; // limit unknown m_compLimitBlocks = 80; // limit unknown
m_compLimitMembers = 64; // soft limit, has slowdown bug as of clang++ 3.8 m_compLimitMembers = 64; // soft limit, has slowdown bug as of clang++ 3.8
m_compLimitParens = 80; // limit unknown m_compLimitParens = 240; // controlled by -fbracket-depth, which defaults to 256
} else if (!strcmp(valp, "gcc")) { } else if (!strcmp(valp, "gcc")) {
m_compLimitBlocks = 0; // Bug free m_compLimitBlocks = 0; // Bug free
m_compLimitMembers = 64; // soft limit, has slowdown bug as of g++ 7.1 m_compLimitMembers = 64; // soft limit, has slowdown bug as of g++ 7.1
m_compLimitParens = 0; // Bug free m_compLimitParens = 240; // Unlimited, but generate same code as for clang
} else if (!strcmp(valp, "msvc")) { } else if (!strcmp(valp, "msvc")) {
m_compLimitBlocks = 80; // 128, but allow some room m_compLimitBlocks = 80; // 128, but allow some room
m_compLimitMembers = 0; // probably ok, and AFAIK doesn't support anon structs m_compLimitMembers = 0; // probably ok, and AFAIK doesn't support anon structs

View File

@ -316,7 +316,7 @@ private:
int m_compLimitBlocks = 0; // compiler selection; number of nested blocks int m_compLimitBlocks = 0; // compiler selection; number of nested blocks
int m_compLimitMembers = 64; // compiler selection; number of members in struct before make anon array int m_compLimitMembers = 64; // compiler selection; number of members in struct before make anon array
int m_compLimitParens = 0; // compiler selection; number of nested parens int m_compLimitParens = 240; // compiler selection; number of nested parens
string m_bin; // main switch: --bin {binary} string m_bin; // main switch: --bin {binary}
string m_exeName; // main switch: -o {name} string m_exeName; // main switch: -o {name}