From 930eaadacfd11273af2f9c3ae21664648dc1e26f Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Wed, 8 Jul 2020 13:20:34 -0700 Subject: [PATCH] [opt] Remove obsolete --quiet option git blame shows these were last touched in 2004? Obsoleted in r13844. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D83409 --- llvm/include/llvm/Support/SystemUtils.h | 7 +-- llvm/lib/Support/SystemUtils.cpp | 13 ++--- llvm/tools/llvm-as/llvm-as.cpp | 2 +- llvm/tools/llvm-extract/llvm-extract.cpp | 2 +- llvm/tools/llvm-link/llvm-link.cpp | 2 +- llvm/tools/opt/PassPrinters.cpp | 72 +++++++++--------------- llvm/tools/opt/PassPrinters.h | 14 ++--- llvm/tools/opt/opt.cpp | 19 ++----- 8 files changed, 50 insertions(+), 81 deletions(-) diff --git a/llvm/include/llvm/Support/SystemUtils.h b/llvm/include/llvm/Support/SystemUtils.h index 77deddb9ee1c..786bea3fcfae 100644 --- a/llvm/include/llvm/Support/SystemUtils.h +++ b/llvm/include/llvm/Support/SystemUtils.h @@ -15,17 +15,16 @@ #define LLVM_SUPPORT_SYSTEMUTILS_H namespace llvm { - class raw_ostream; +class raw_ostream; /// Determine if the raw_ostream provided is connected to a terminal. If so, /// generate a warning message to errs() advising against display of bitcode /// and return true. Otherwise just return false. /// Check for output written to a console bool CheckBitcodeOutputToConsole( - raw_ostream &stream_to_check, ///< The stream to be checked - bool print_warning = true ///< Control whether warnings are printed + raw_ostream &stream_to_check ///< The stream to be checked ); -} // End llvm namespace +} // namespace llvm #endif diff --git a/llvm/lib/Support/SystemUtils.cpp b/llvm/lib/Support/SystemUtils.cpp index 47e0c72ec7c1..f1149e48dce5 100644 --- a/llvm/lib/Support/SystemUtils.cpp +++ b/llvm/lib/Support/SystemUtils.cpp @@ -15,15 +15,12 @@ #include "llvm/Support/raw_ostream.h" using namespace llvm; -bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check, - bool print_warning) { +bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check) { if (stream_to_check.is_displayed()) { - if (print_warning) { - errs() << "WARNING: You're attempting to print out a bitcode file.\n" - "This is inadvisable as it may cause display problems. If\n" - "you REALLY want to taste LLVM bitcode first-hand, you\n" - "can force output with the `-f' option.\n\n"; - } + errs() << "WARNING: You're attempting to print out a bitcode file.\n" + "This is inadvisable as it may cause display problems. If\n" + "you REALLY want to taste LLVM bitcode first-hand, you\n" + "can force output with the `-f' option.\n\n"; return true; } return false; diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp index 699e9121b88a..f2b52890a7f5 100644 --- a/llvm/tools/llvm-as/llvm-as.cpp +++ b/llvm/tools/llvm-as/llvm-as.cpp @@ -88,7 +88,7 @@ static void WriteOutputFile(const Module *M, const ModuleSummaryIndex *Index) { exit(1); } - if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) { + if (Force || !CheckBitcodeOutputToConsole(Out->os())) { const ModuleSummaryIndex *IndexToWrite = nullptr; // Don't attempt to write a summary index unless it contains any entries or // has non-zero flags. The latter is used to assemble dummy index files for diff --git a/llvm/tools/llvm-extract/llvm-extract.cpp b/llvm/tools/llvm-extract/llvm-extract.cpp index 9be4627e2ed7..cb1c4116ff19 100644 --- a/llvm/tools/llvm-extract/llvm-extract.cpp +++ b/llvm/tools/llvm-extract/llvm-extract.cpp @@ -381,7 +381,7 @@ int main(int argc, char **argv) { if (OutputAssembly) Passes.add( createPrintModulePass(Out.os(), "", PreserveAssemblyUseListOrder)); - else if (Force || !CheckBitcodeOutputToConsole(Out.os(), true)) + else if (Force || !CheckBitcodeOutputToConsole(Out.os())) Passes.add(createBitcodeWriterPass(Out.os(), PreserveBitcodeUseListOrder)); Passes.run(*M.get()); diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp index d99659f3d50a..a7cda24bbe0a 100644 --- a/llvm/tools/llvm-link/llvm-link.cpp +++ b/llvm/tools/llvm-link/llvm-link.cpp @@ -399,7 +399,7 @@ int main(int argc, char **argv) { errs() << "Writing bitcode...\n"; if (OutputAssembly) { Composite->print(Out.os(), nullptr, PreserveAssemblyUseListOrder); - } else if (Force || !CheckBitcodeOutputToConsole(Out.os(), true)) + } else if (Force || !CheckBitcodeOutputToConsole(Out.os())) WriteBitcodeToFile(*Composite, Out.os(), PreserveBitcodeUseListOrder); // Declare success. diff --git a/llvm/tools/opt/PassPrinters.cpp b/llvm/tools/opt/PassPrinters.cpp index ed4fc1a8174b..4e81b5d29c4d 100644 --- a/llvm/tools/opt/PassPrinters.cpp +++ b/llvm/tools/opt/PassPrinters.cpp @@ -33,18 +33,16 @@ struct FunctionPassPrinter : public FunctionPass { raw_ostream &Out; static char ID; std::string PassName; - bool QuietPass; - FunctionPassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet) - : FunctionPass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) { + FunctionPassPrinter(const PassInfo *PI, raw_ostream &out) + : FunctionPass(ID), PassToPrint(PI), Out(out) { std::string PassToPrintName = std::string(PassToPrint->getPassName()); PassName = "FunctionPass Printer: " + PassToPrintName; } bool runOnFunction(Function &F) override { - if (!QuietPass) - Out << "Printing analysis '" << PassToPrint->getPassName() - << "' for function '" << F.getName() << "':\n"; + Out << "Printing analysis '" << PassToPrint->getPassName() + << "' for function '" << F.getName() << "':\n"; // Get and print pass... getAnalysisID(PassToPrint->getTypeInfo()).print(Out, F.getParent()); @@ -66,17 +64,15 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass { const PassInfo *PassToPrint; raw_ostream &Out; std::string PassName; - bool QuietPass; - CallGraphSCCPassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet) - : CallGraphSCCPass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) { + CallGraphSCCPassPrinter(const PassInfo *PI, raw_ostream &out) + : CallGraphSCCPass(ID), PassToPrint(PI), Out(out) { std::string PassToPrintName = std::string(PassToPrint->getPassName()); PassName = "CallGraphSCCPass Printer: " + PassToPrintName; } bool runOnSCC(CallGraphSCC &SCC) override { - if (!QuietPass) - Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; + Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; // Get and print pass... for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { @@ -103,17 +99,15 @@ struct ModulePassPrinter : public ModulePass { const PassInfo *PassToPrint; raw_ostream &Out; std::string PassName; - bool QuietPass; - ModulePassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet) - : ModulePass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) { + ModulePassPrinter(const PassInfo *PI, raw_ostream &out) + : ModulePass(ID), PassToPrint(PI), Out(out) { std::string PassToPrintName = std::string(PassToPrint->getPassName()); PassName = "ModulePass Printer: " + PassToPrintName; } bool runOnModule(Module &M) override { - if (!QuietPass) - Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; + Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; // Get and print pass... getAnalysisID(PassToPrint->getTypeInfo()).print(Out, &M); @@ -135,17 +129,15 @@ struct LoopPassPrinter : public LoopPass { const PassInfo *PassToPrint; raw_ostream &Out; std::string PassName; - bool QuietPass; - LoopPassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet) - : LoopPass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) { + LoopPassPrinter(const PassInfo *PI, raw_ostream &out) + : LoopPass(ID), PassToPrint(PI), Out(out) { std::string PassToPrintName = std::string(PassToPrint->getPassName()); PassName = "LoopPass Printer: " + PassToPrintName; } bool runOnLoop(Loop *L, LPPassManager &LPM) override { - if (!QuietPass) - Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; + Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; // Get and print pass... getAnalysisID(PassToPrint->getTypeInfo()) @@ -168,20 +160,17 @@ struct RegionPassPrinter : public RegionPass { const PassInfo *PassToPrint; raw_ostream &Out; std::string PassName; - bool QuietPass; - RegionPassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet) - : RegionPass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) { + RegionPassPrinter(const PassInfo *PI, raw_ostream &out) + : RegionPass(ID), PassToPrint(PI), Out(out) { std::string PassToPrintName = std::string(PassToPrint->getPassName()); PassName = "RegionPass Printer: " + PassToPrintName; } bool runOnRegion(Region *R, RGPassManager &RGM) override { - if (!QuietPass) { - Out << "Printing analysis '" << PassToPrint->getPassName() << "' for " - << "region: '" << R->getNameStr() << "' in function '" - << R->getEntry()->getParent()->getName() << "':\n"; - } + Out << "Printing analysis '" << PassToPrint->getPassName() << "' for " + << "region: '" << R->getNameStr() << "' in function '" + << R->getEntry()->getParent()->getName() << "':\n"; // Get and print pass... getAnalysisID(PassToPrint->getTypeInfo()) .print(Out, R->getEntry()->getParent()->getParent()); @@ -201,28 +190,23 @@ char RegionPassPrinter::ID = 0; } // end anonymous namespace FunctionPass *llvm::createFunctionPassPrinter(const PassInfo *PI, - raw_ostream &OS, bool Quiet) { - return new FunctionPassPrinter(PI, OS, Quiet); + raw_ostream &OS) { + return new FunctionPassPrinter(PI, OS); } CallGraphSCCPass *llvm::createCallGraphPassPrinter(const PassInfo *PI, - raw_ostream &OS, - bool Quiet) { - return new CallGraphSCCPassPrinter(PI, OS, Quiet); + raw_ostream &OS) { + return new CallGraphSCCPassPrinter(PI, OS); } -ModulePass *llvm::createModulePassPrinter(const PassInfo *PI, raw_ostream &OS, - bool Quiet) { - return new ModulePassPrinter(PI, OS, Quiet); +ModulePass *llvm::createModulePassPrinter(const PassInfo *PI, raw_ostream &OS) { + return new ModulePassPrinter(PI, OS); } -LoopPass *llvm::createLoopPassPrinter(const PassInfo *PI, raw_ostream &OS, - bool Quiet) { - return new LoopPassPrinter(PI, OS, Quiet); +LoopPass *llvm::createLoopPassPrinter(const PassInfo *PI, raw_ostream &OS) { + return new LoopPassPrinter(PI, OS); } -RegionPass *llvm::createRegionPassPrinter(const PassInfo *PI, raw_ostream &OS, - bool Quiet) { - return new RegionPassPrinter(PI, OS, Quiet); +RegionPass *llvm::createRegionPassPrinter(const PassInfo *PI, raw_ostream &OS) { + return new RegionPassPrinter(PI, OS); } - diff --git a/llvm/tools/opt/PassPrinters.h b/llvm/tools/opt/PassPrinters.h index 9342c46f2ff6..a4e1921399fc 100644 --- a/llvm/tools/opt/PassPrinters.h +++ b/llvm/tools/opt/PassPrinters.h @@ -24,20 +24,16 @@ class PassInfo; class raw_ostream; class RegionPass; -FunctionPass *createFunctionPassPrinter(const PassInfo *PI, raw_ostream &out, - bool Quiet); +FunctionPass *createFunctionPassPrinter(const PassInfo *PI, raw_ostream &out); CallGraphSCCPass *createCallGraphPassPrinter(const PassInfo *PI, - raw_ostream &out, bool Quiet); + raw_ostream &out); -ModulePass *createModulePassPrinter(const PassInfo *PI, raw_ostream &out, - bool Quiet); +ModulePass *createModulePassPrinter(const PassInfo *PI, raw_ostream &out); -LoopPass *createLoopPassPrinter(const PassInfo *PI, raw_ostream &out, - bool Quiet); +LoopPass *createLoopPassPrinter(const PassInfo *PI, raw_ostream &out); -RegionPass *createRegionPassPrinter(const PassInfo *PI, raw_ostream &out, - bool Quiet); +RegionPass *createRegionPassPrinter(const PassInfo *PI, raw_ostream &out); } // end namespace llvm diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 0e52134f0100..c250eefb8c43 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -203,13 +203,6 @@ DisableBuiltins("disable-builtin", cl::desc("Disable specific target library builtin function"), cl::ZeroOrMore); - -static cl::opt -Quiet("q", cl::desc("Obsolete option"), cl::Hidden); - -static cl::alias -QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet)); - static cl::opt AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization")); @@ -730,7 +723,7 @@ int main(int argc, char **argv) { // console, print out a warning message and refuse to do it. We don't // impress anyone by spewing tons of binary goo to a terminal. if (!Force && !NoOutput && !AnalyzeOnly && !OutputAssembly) - if (CheckBitcodeOutputToConsole(Out->os(), !Quiet)) + if (CheckBitcodeOutputToConsole(Out->os())) NoOutput = true; if (OutputThinLTOBC) @@ -900,19 +893,19 @@ int main(int argc, char **argv) { if (AnalyzeOnly) { switch (Kind) { case PT_Region: - Passes.add(createRegionPassPrinter(PassInf, Out->os(), Quiet)); + Passes.add(createRegionPassPrinter(PassInf, Out->os())); break; case PT_Loop: - Passes.add(createLoopPassPrinter(PassInf, Out->os(), Quiet)); + Passes.add(createLoopPassPrinter(PassInf, Out->os())); break; case PT_Function: - Passes.add(createFunctionPassPrinter(PassInf, Out->os(), Quiet)); + Passes.add(createFunctionPassPrinter(PassInf, Out->os())); break; case PT_CallGraphSCC: - Passes.add(createCallGraphPassPrinter(PassInf, Out->os(), Quiet)); + Passes.add(createCallGraphPassPrinter(PassInf, Out->os())); break; default: - Passes.add(createModulePassPrinter(PassInf, Out->os(), Quiet)); + Passes.add(createModulePassPrinter(PassInf, Out->os())); break; } }