Skip to content

Commit baab447

Browse files
authored
[llc] Report error in lieu of warning for invalid cl option (#128846)
1 parent de60c0e commit baab447

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
; RUN: not llc -mtriple=x86_64-pc-linux-gnu -passes=foo -start-before=mergeicmps -stop-after=gc-lowering -filetype=null %s 2>&1 | FileCheck %s
22

3-
; CHECK: warning: --passes cannot be used with start-before and stop-after.
3+
; CHECK: error: --passes cannot be used with start-before and stop-after.

llvm/tools/llc/NewPMDriver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int llvm::compileModuleWithNewPM(
9393
CodeGenFileType FileType) {
9494

9595
if (!PassPipeline.empty() && TargetPassConfig::hasLimitedCodeGenPipeline()) {
96-
WithColor::warning(errs(), Arg0)
96+
WithColor::error(errs(), Arg0)
9797
<< "--passes cannot be used with "
9898
<< TargetPassConfig::getLimitedCodeGenPipelineReason() << ".\n";
9999
return 1;
@@ -139,7 +139,7 @@ int llvm::compileModuleWithNewPM(
139139
// selection.
140140

141141
if (!MIR) {
142-
WithColor::warning(errs(), Arg0) << "-passes is for .mir file only.\n";
142+
WithColor::error(errs(), Arg0) << "-passes is for .mir file only.\n";
143143
return 1;
144144
}
145145

llvm/tools/llc/llc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,15 +678,15 @@ static int compileModule(char **argv, LLVMContext &Context) {
678678
// selection.
679679
if (!getRunPassNames().empty()) {
680680
if (!MIR) {
681-
WithColor::warning(errs(), argv[0])
681+
WithColor::error(errs(), argv[0])
682682
<< "run-pass is for .mir file only.\n";
683683
delete MMIWP;
684684
return 1;
685685
}
686686
TargetPassConfig *PTPC = Target->createPassConfig(PM);
687687
TargetPassConfig &TPC = *PTPC;
688688
if (TPC.hasLimitedCodeGenPipeline()) {
689-
WithColor::warning(errs(), argv[0])
689+
WithColor::error(errs(), argv[0])
690690
<< "run-pass cannot be used with "
691691
<< TPC.getLimitedCodeGenPipelineReason() << ".\n";
692692
delete PTPC;

0 commit comments

Comments
 (0)