aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetPassConfig.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-05-30 08:06:53 +0200
committerGitHub <noreply@github.com>2025-05-30 08:06:53 +0200
commit36b710a7e5c3bb382425c49d65400bc4adf5d1af (patch)
treed35d2d3e56dc6a264d7363618120e95dd99cf32d /llvm/lib/CodeGen/TargetPassConfig.cpp
parent72a3c7610b4f97b43d5cd30f1d5b95bad5e77640 (diff)
downloadllvm-36b710a7e5c3bb382425c49d65400bc4adf5d1af.zip
llvm-36b710a7e5c3bb382425c49d65400bc4adf5d1af.tar.gz
llvm-36b710a7e5c3bb382425c49d65400bc4adf5d1af.tar.bz2
CodeGen: Convert some assorted errors to use reportFatalUsageError (#142031)
The test coverage is lacking for many of these errors.
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetPassConfig.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index 0095ce3..4ae52b0 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -421,8 +421,8 @@ static const PassInfo *getPassInfo(StringRef PassName) {
const PassRegistry &PR = *PassRegistry::getPassRegistry();
const PassInfo *PI = PR.getPassInfo(PassName);
if (!PI)
- report_fatal_error(Twine('\"') + Twine(PassName) +
- Twine("\" pass is not registered."));
+ reportFatalUsageError(Twine('\"') + Twine(PassName) +
+ Twine("\" pass is not registered."));
return PI;
}
@@ -438,7 +438,7 @@ getPassNameAndInstanceNum(StringRef PassName) {
unsigned InstanceNum = 0;
if (!InstanceNumStr.empty() && InstanceNumStr.getAsInteger(10, InstanceNum))
- report_fatal_error("invalid pass instance specifier " + PassName);
+ reportFatalUsageError("invalid pass instance specifier " + PassName);
return std::make_pair(Name, InstanceNum);
}
@@ -465,11 +465,11 @@ void TargetPassConfig::setStartStopPasses() {
StopBefore = getPassIDFromName(StopBeforeName);
StopAfter = getPassIDFromName(StopAfterName);
if (StartBefore && StartAfter)
- report_fatal_error(Twine(StartBeforeOptName) + Twine(" and ") +
- Twine(StartAfterOptName) + Twine(" specified!"));
+ reportFatalUsageError(Twine(StartBeforeOptName) + Twine(" and ") +
+ Twine(StartAfterOptName) + Twine(" specified!"));
if (StopBefore && StopAfter)
- report_fatal_error(Twine(StopBeforeOptName) + Twine(" and ") +
- Twine(StopAfterOptName) + Twine(" specified!"));
+ reportFatalUsageError(Twine(StopBeforeOptName) + Twine(" and ") +
+ Twine(StopAfterOptName) + Twine(" specified!"));
Started = (StartAfter == nullptr) && (StartBefore == nullptr);
}
@@ -635,9 +635,9 @@ CodeGenTargetMachineImpl::createPassConfig(PassManagerBase &PM) {
TargetPassConfig::TargetPassConfig()
: ImmutablePass(ID) {
- report_fatal_error("Trying to construct TargetPassConfig without a target "
- "machine. Scheduling a CodeGen pass without a target "
- "triple set?");
+ reportFatalUsageError("trying to construct TargetPassConfig without a target "
+ "machine. Scheduling a CodeGen pass without a target "
+ "triple set?");
}
bool TargetPassConfig::willCompleteCodeGenPipeline() {
@@ -738,7 +738,7 @@ void TargetPassConfig::addPass(Pass *P) {
if (StartAfter == PassID && StartAfterCount++ == StartAfterInstanceNum)
Started = true;
if (Stopped && !Started)
- report_fatal_error("Cannot stop compilation after pass that is not run");
+ reportFatalUsageError("Cannot stop compilation after pass that is not run");
}
/// Add a CodeGen pass at this point in the pipeline after checking for target
@@ -1408,7 +1408,8 @@ bool TargetPassConfig::isCustomizedRegAlloc() {
bool TargetPassConfig::addRegAssignAndRewriteFast() {
if (RegAlloc != (RegisterRegAlloc::FunctionPassCtor)&useDefaultRegisterAllocator &&
RegAlloc != (RegisterRegAlloc::FunctionPassCtor)&createFastRegisterAllocator)
- report_fatal_error("Must use fast (default) register allocator for unoptimized regalloc.");
+ reportFatalUsageError(
+ "Must use fast (default) register allocator for unoptimized regalloc.");
addPass(createRegAllocPass(false));