diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 78e60ad0c..2c7c274f5 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -583,7 +583,7 @@ void CommandLineInterface::createJson(string const& _fileName, string const& _js bool CommandLineInterface::parseArguments(int _argc, char const* const* _argv) { - CommandLineParser parser(serr(/* _markAsUsed */ false)); + CommandLineParser parser; if (isatty(fileno(stdin)) && _argc == 1) { @@ -604,7 +604,6 @@ bool CommandLineInterface::parseArguments(int _argc, char const* const* _argv) return false; } - m_hasOutput = m_hasOutput || parser.hasOutput(); m_options = parser.options(); return true; @@ -1003,6 +1002,8 @@ bool CommandLineInterface::assemble(yul::AssemblyStack::Language _language, yul: { solAssert(m_options.input.mode == InputMode::Assembler, ""); + serr() << "Warning: Yul is still experimental. Please use the output with care." << endl; + bool successful = true; map assemblyStacks; for (auto const& src: m_fileReader.sourceCodes()) diff --git a/solc/CommandLineParser.cpp b/solc/CommandLineParser.cpp index cdd74a217..87348686c 100644 --- a/solc/CommandLineParser.cpp +++ b/solc/CommandLineParser.cpp @@ -38,14 +38,6 @@ namespace po = boost::program_options; namespace solidity::frontend { -ostream& CommandLineParser::serr() -{ - m_hasOutput = true; - return m_serr; -} - -#define cerr - static string const g_strAllowPaths = "allow-paths"; static string const g_strBasePath = "base-path"; static string const g_strIncludePath = "include-path"; @@ -278,8 +270,6 @@ OptimiserSettings CommandLineOptions::optimiserSettings() const void CommandLineParser::parse(int _argc, char const* const* _argv) { - m_hasOutput = false; - parseArgs(_argc, _argv); processArgs(); } @@ -1167,8 +1157,6 @@ void CommandLineParser::processArgs() "The selected input language is not directly supported when targeting the Ewasm machine " "and automatic translation is not available." ); - - serr() << "Warning: Yul is still experimental. Please use the output with care." << endl; return; } else if (countEnabledOptions({g_strYulDialect, g_strMachine}) >= 1) diff --git a/solc/CommandLineParser.h b/solc/CommandLineParser.h index 33a4a2455..c1a95a11f 100644 --- a/solc/CommandLineParser.h +++ b/solc/CommandLineParser.h @@ -238,10 +238,6 @@ struct CommandLineOptions class CommandLineParser { public: - explicit CommandLineParser(std::ostream& _serr): - m_serr(_serr) - {} - /// Parses the command-line arguments and fills out the internal CommandLineOptions structure. /// @throws CommandLineValidationError if the arguments cannot be properly parsed or are invalid. /// When an exception is thrown, the @p CommandLineOptions may be only partially filled out. @@ -249,9 +245,6 @@ public: CommandLineOptions const& options() const { return m_options; } - /// Returns true if the parser has written anything to any of its output streams. - bool hasOutput() const { return m_hasOutput; } - static void printHelp(std::ostream& _out) { _out << optionsDescription(); } private: @@ -292,13 +285,6 @@ private: size_t countEnabledOptions(std::vector const& _optionNames) const; static std::string joinOptionNames(std::vector const& _optionNames, std::string _separator = ", "); - /// Returns the stream that should receive error output. Sets m_hasOutput to true if the - /// stream has ever been used. - std::ostream& serr(); - - std::ostream& m_serr; - bool m_hasOutput = false; - CommandLineOptions m_options; /// Map of command-line arguments produced by boost::program_options. diff --git a/test/solc/CommandLineParser.cpp b/test/solc/CommandLineParser.cpp index 385ab279a..c2eab2355 100644 --- a/test/solc/CommandLineParser.cpp +++ b/test/solc/CommandLineParser.cpp @@ -51,8 +51,7 @@ CommandLineOptions parseCommandLine(vector const& _commandLine) { vector argv = test::makeArgv(_commandLine); - stringstream serr; - CommandLineParser cliParser(serr); + CommandLineParser cliParser; cliParser.parse(static_cast(_commandLine.size()), argv.data()); return cliParser.options(); }