From 4a31b69f8477d53a98a2da91ff7142a0e9e25ff9 Mon Sep 17 00:00:00 2001 From: Kuba Ober Date: Fri, 20 Dec 2019 20:07:50 -0500 Subject: [PATCH] Decrease the number of chained if-else blocks to fix MSVC build. Pull (#7) MSVC has a limit of 128 blocks in a chain. --- src/V3Options.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 4da975ade..328755ae9 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -727,6 +727,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char VOptionBool bflag; // Allow gnu -- switches if (sw[0]=='-' && sw[1]=='-') ++sw; + bool hadSwitchPart1 = true; if (0) {} // Single switches else if (!strcmp(sw, "-E")) { m_preprocOnly = true; } @@ -799,6 +800,8 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char else if ( onoff (sw, "-Wpedantic", flag/*ref*/)) { m_pedantic = flag; } else if ( onoff (sw, "-x-initial-edge", flag/*ref*/)) { m_xInitialEdge = flag; } else if ( onoff (sw, "-xml-only", flag/*ref*/)) { m_xmlOnly = flag; } // Undocumented, still experimental + else { hadSwitchPart1 = false; } + if (hadSwitchPart1) {} // Optimization else if (!strncmp (sw, "-O", 2)) { for (const char* cp=sw+strlen("-O"); *cp; ++cp) {