Skip to content

Commit 930eaad

Browse files
committed
[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
1 parent 6e089e9 commit 930eaad

File tree

8 files changed

+50
-81
lines changed

8 files changed

+50
-81
lines changed

llvm/include/llvm/Support/SystemUtils.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@
1515
#define LLVM_SUPPORT_SYSTEMUTILS_H
1616

1717
namespace llvm {
18-
class raw_ostream;
18+
class raw_ostream;
1919

2020
/// Determine if the raw_ostream provided is connected to a terminal. If so,
2121
/// generate a warning message to errs() advising against display of bitcode
2222
/// and return true. Otherwise just return false.
2323
/// Check for output written to a console
2424
bool CheckBitcodeOutputToConsole(
25-
raw_ostream &stream_to_check, ///< The stream to be checked
26-
bool print_warning = true ///< Control whether warnings are printed
25+
raw_ostream &stream_to_check ///< The stream to be checked
2726
);
2827

29-
} // End llvm namespace
28+
} // namespace llvm
3029

3130
#endif

llvm/lib/Support/SystemUtils.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@
1515
#include "llvm/Support/raw_ostream.h"
1616
using namespace llvm;
1717

18-
bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check,
19-
bool print_warning) {
18+
bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check) {
2019
if (stream_to_check.is_displayed()) {
21-
if (print_warning) {
22-
errs() << "WARNING: You're attempting to print out a bitcode file.\n"
23-
"This is inadvisable as it may cause display problems. If\n"
24-
"you REALLY want to taste LLVM bitcode first-hand, you\n"
25-
"can force output with the `-f' option.\n\n";
26-
}
20+
errs() << "WARNING: You're attempting to print out a bitcode file.\n"
21+
"This is inadvisable as it may cause display problems. If\n"
22+
"you REALLY want to taste LLVM bitcode first-hand, you\n"
23+
"can force output with the `-f' option.\n\n";
2724
return true;
2825
}
2926
return false;

llvm/tools/llvm-as/llvm-as.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static void WriteOutputFile(const Module *M, const ModuleSummaryIndex *Index) {
8888
exit(1);
8989
}
9090

91-
if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) {
91+
if (Force || !CheckBitcodeOutputToConsole(Out->os())) {
9292
const ModuleSummaryIndex *IndexToWrite = nullptr;
9393
// Don't attempt to write a summary index unless it contains any entries or
9494
// has non-zero flags. The latter is used to assemble dummy index files for

llvm/tools/llvm-extract/llvm-extract.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ int main(int argc, char **argv) {
381381
if (OutputAssembly)
382382
Passes.add(
383383
createPrintModulePass(Out.os(), "", PreserveAssemblyUseListOrder));
384-
else if (Force || !CheckBitcodeOutputToConsole(Out.os(), true))
384+
else if (Force || !CheckBitcodeOutputToConsole(Out.os()))
385385
Passes.add(createBitcodeWriterPass(Out.os(), PreserveBitcodeUseListOrder));
386386

387387
Passes.run(*M.get());

llvm/tools/llvm-link/llvm-link.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ int main(int argc, char **argv) {
399399
errs() << "Writing bitcode...\n";
400400
if (OutputAssembly) {
401401
Composite->print(Out.os(), nullptr, PreserveAssemblyUseListOrder);
402-
} else if (Force || !CheckBitcodeOutputToConsole(Out.os(), true))
402+
} else if (Force || !CheckBitcodeOutputToConsole(Out.os()))
403403
WriteBitcodeToFile(*Composite, Out.os(), PreserveBitcodeUseListOrder);
404404

405405
// Declare success.

llvm/tools/opt/PassPrinters.cpp

Lines changed: 28 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,16 @@ struct FunctionPassPrinter : public FunctionPass {
3333
raw_ostream &Out;
3434
static char ID;
3535
std::string PassName;
36-
bool QuietPass;
3736

38-
FunctionPassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet)
39-
: FunctionPass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) {
37+
FunctionPassPrinter(const PassInfo *PI, raw_ostream &out)
38+
: FunctionPass(ID), PassToPrint(PI), Out(out) {
4039
std::string PassToPrintName = std::string(PassToPrint->getPassName());
4140
PassName = "FunctionPass Printer: " + PassToPrintName;
4241
}
4342

4443
bool runOnFunction(Function &F) override {
45-
if (!QuietPass)
46-
Out << "Printing analysis '" << PassToPrint->getPassName()
47-
<< "' for function '" << F.getName() << "':\n";
44+
Out << "Printing analysis '" << PassToPrint->getPassName()
45+
<< "' for function '" << F.getName() << "':\n";
4846

4947
// Get and print pass...
5048
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, F.getParent());
@@ -66,17 +64,15 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
6664
const PassInfo *PassToPrint;
6765
raw_ostream &Out;
6866
std::string PassName;
69-
bool QuietPass;
7067

71-
CallGraphSCCPassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet)
72-
: CallGraphSCCPass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) {
68+
CallGraphSCCPassPrinter(const PassInfo *PI, raw_ostream &out)
69+
: CallGraphSCCPass(ID), PassToPrint(PI), Out(out) {
7370
std::string PassToPrintName = std::string(PassToPrint->getPassName());
7471
PassName = "CallGraphSCCPass Printer: " + PassToPrintName;
7572
}
7673

7774
bool runOnSCC(CallGraphSCC &SCC) override {
78-
if (!QuietPass)
79-
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
75+
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
8076

8177
// Get and print pass...
8278
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
@@ -103,17 +99,15 @@ struct ModulePassPrinter : public ModulePass {
10399
const PassInfo *PassToPrint;
104100
raw_ostream &Out;
105101
std::string PassName;
106-
bool QuietPass;
107102

108-
ModulePassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet)
109-
: ModulePass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) {
103+
ModulePassPrinter(const PassInfo *PI, raw_ostream &out)
104+
: ModulePass(ID), PassToPrint(PI), Out(out) {
110105
std::string PassToPrintName = std::string(PassToPrint->getPassName());
111106
PassName = "ModulePass Printer: " + PassToPrintName;
112107
}
113108

114109
bool runOnModule(Module &M) override {
115-
if (!QuietPass)
116-
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
110+
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
117111

118112
// Get and print pass...
119113
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, &M);
@@ -135,17 +129,15 @@ struct LoopPassPrinter : public LoopPass {
135129
const PassInfo *PassToPrint;
136130
raw_ostream &Out;
137131
std::string PassName;
138-
bool QuietPass;
139132

140-
LoopPassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet)
141-
: LoopPass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) {
133+
LoopPassPrinter(const PassInfo *PI, raw_ostream &out)
134+
: LoopPass(ID), PassToPrint(PI), Out(out) {
142135
std::string PassToPrintName = std::string(PassToPrint->getPassName());
143136
PassName = "LoopPass Printer: " + PassToPrintName;
144137
}
145138

146139
bool runOnLoop(Loop *L, LPPassManager &LPM) override {
147-
if (!QuietPass)
148-
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
140+
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
149141

150142
// Get and print pass...
151143
getAnalysisID<Pass>(PassToPrint->getTypeInfo())
@@ -168,20 +160,17 @@ struct RegionPassPrinter : public RegionPass {
168160
const PassInfo *PassToPrint;
169161
raw_ostream &Out;
170162
std::string PassName;
171-
bool QuietPass;
172163

173-
RegionPassPrinter(const PassInfo *PI, raw_ostream &out, bool Quiet)
174-
: RegionPass(ID), PassToPrint(PI), Out(out), QuietPass(Quiet) {
164+
RegionPassPrinter(const PassInfo *PI, raw_ostream &out)
165+
: RegionPass(ID), PassToPrint(PI), Out(out) {
175166
std::string PassToPrintName = std::string(PassToPrint->getPassName());
176167
PassName = "RegionPass Printer: " + PassToPrintName;
177168
}
178169

179170
bool runOnRegion(Region *R, RGPassManager &RGM) override {
180-
if (!QuietPass) {
181-
Out << "Printing analysis '" << PassToPrint->getPassName() << "' for "
182-
<< "region: '" << R->getNameStr() << "' in function '"
183-
<< R->getEntry()->getParent()->getName() << "':\n";
184-
}
171+
Out << "Printing analysis '" << PassToPrint->getPassName() << "' for "
172+
<< "region: '" << R->getNameStr() << "' in function '"
173+
<< R->getEntry()->getParent()->getName() << "':\n";
185174
// Get and print pass...
186175
getAnalysisID<Pass>(PassToPrint->getTypeInfo())
187176
.print(Out, R->getEntry()->getParent()->getParent());
@@ -201,28 +190,23 @@ char RegionPassPrinter::ID = 0;
201190
} // end anonymous namespace
202191

203192
FunctionPass *llvm::createFunctionPassPrinter(const PassInfo *PI,
204-
raw_ostream &OS, bool Quiet) {
205-
return new FunctionPassPrinter(PI, OS, Quiet);
193+
raw_ostream &OS) {
194+
return new FunctionPassPrinter(PI, OS);
206195
}
207196

208197
CallGraphSCCPass *llvm::createCallGraphPassPrinter(const PassInfo *PI,
209-
raw_ostream &OS,
210-
bool Quiet) {
211-
return new CallGraphSCCPassPrinter(PI, OS, Quiet);
198+
raw_ostream &OS) {
199+
return new CallGraphSCCPassPrinter(PI, OS);
212200
}
213201

214-
ModulePass *llvm::createModulePassPrinter(const PassInfo *PI, raw_ostream &OS,
215-
bool Quiet) {
216-
return new ModulePassPrinter(PI, OS, Quiet);
202+
ModulePass *llvm::createModulePassPrinter(const PassInfo *PI, raw_ostream &OS) {
203+
return new ModulePassPrinter(PI, OS);
217204
}
218205

219-
LoopPass *llvm::createLoopPassPrinter(const PassInfo *PI, raw_ostream &OS,
220-
bool Quiet) {
221-
return new LoopPassPrinter(PI, OS, Quiet);
206+
LoopPass *llvm::createLoopPassPrinter(const PassInfo *PI, raw_ostream &OS) {
207+
return new LoopPassPrinter(PI, OS);
222208
}
223209

224-
RegionPass *llvm::createRegionPassPrinter(const PassInfo *PI, raw_ostream &OS,
225-
bool Quiet) {
226-
return new RegionPassPrinter(PI, OS, Quiet);
210+
RegionPass *llvm::createRegionPassPrinter(const PassInfo *PI, raw_ostream &OS) {
211+
return new RegionPassPrinter(PI, OS);
227212
}
228-

llvm/tools/opt/PassPrinters.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,16 @@ class PassInfo;
2424
class raw_ostream;
2525
class RegionPass;
2626

27-
FunctionPass *createFunctionPassPrinter(const PassInfo *PI, raw_ostream &out,
28-
bool Quiet);
27+
FunctionPass *createFunctionPassPrinter(const PassInfo *PI, raw_ostream &out);
2928

3029
CallGraphSCCPass *createCallGraphPassPrinter(const PassInfo *PI,
31-
raw_ostream &out, bool Quiet);
30+
raw_ostream &out);
3231

33-
ModulePass *createModulePassPrinter(const PassInfo *PI, raw_ostream &out,
34-
bool Quiet);
32+
ModulePass *createModulePassPrinter(const PassInfo *PI, raw_ostream &out);
3533

36-
LoopPass *createLoopPassPrinter(const PassInfo *PI, raw_ostream &out,
37-
bool Quiet);
34+
LoopPass *createLoopPassPrinter(const PassInfo *PI, raw_ostream &out);
3835

39-
RegionPass *createRegionPassPrinter(const PassInfo *PI, raw_ostream &out,
40-
bool Quiet);
36+
RegionPass *createRegionPassPrinter(const PassInfo *PI, raw_ostream &out);
4137

4238
} // end namespace llvm
4339

llvm/tools/opt/opt.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,6 @@ DisableBuiltins("disable-builtin",
203203
cl::desc("Disable specific target library builtin function"),
204204
cl::ZeroOrMore);
205205

206-
207-
static cl::opt<bool>
208-
Quiet("q", cl::desc("Obsolete option"), cl::Hidden);
209-
210-
static cl::alias
211-
QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet));
212-
213206
static cl::opt<bool>
214207
AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization"));
215208

@@ -730,7 +723,7 @@ int main(int argc, char **argv) {
730723
// console, print out a warning message and refuse to do it. We don't
731724
// impress anyone by spewing tons of binary goo to a terminal.
732725
if (!Force && !NoOutput && !AnalyzeOnly && !OutputAssembly)
733-
if (CheckBitcodeOutputToConsole(Out->os(), !Quiet))
726+
if (CheckBitcodeOutputToConsole(Out->os()))
734727
NoOutput = true;
735728

736729
if (OutputThinLTOBC)
@@ -900,19 +893,19 @@ int main(int argc, char **argv) {
900893
if (AnalyzeOnly) {
901894
switch (Kind) {
902895
case PT_Region:
903-
Passes.add(createRegionPassPrinter(PassInf, Out->os(), Quiet));
896+
Passes.add(createRegionPassPrinter(PassInf, Out->os()));
904897
break;
905898
case PT_Loop:
906-
Passes.add(createLoopPassPrinter(PassInf, Out->os(), Quiet));
899+
Passes.add(createLoopPassPrinter(PassInf, Out->os()));
907900
break;
908901
case PT_Function:
909-
Passes.add(createFunctionPassPrinter(PassInf, Out->os(), Quiet));
902+
Passes.add(createFunctionPassPrinter(PassInf, Out->os()));
910903
break;
911904
case PT_CallGraphSCC:
912-
Passes.add(createCallGraphPassPrinter(PassInf, Out->os(), Quiet));
905+
Passes.add(createCallGraphPassPrinter(PassInf, Out->os()));
913906
break;
914907
default:
915-
Passes.add(createModulePassPrinter(PassInf, Out->os(), Quiet));
908+
Passes.add(createModulePassPrinter(PassInf, Out->os()));
916909
break;
917910
}
918911
}

0 commit comments

Comments
 (0)