aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTOBackend.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2021-10-06 12:04:30 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2021-10-06 12:04:30 +0100
commit21661607cabd3927a56481e5382c4a68ffe6c2f3 (patch)
tree6849c57fa382454f4703587462f44dc0ecbd365b /llvm/lib/LTO/LTOBackend.cpp
parentb9b90bb5426ffc23cf90f133a90d1469d263522c (diff)
downloadllvm-21661607cabd3927a56481e5382c4a68ffe6c2f3.zip
llvm-21661607cabd3927a56481e5382c4a68ffe6c2f3.tar.gz
llvm-21661607cabd3927a56481e5382c4a68ffe6c2f3.tar.bz2
[llvm] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine)
As described on D111049, we're trying to remove the <string> dependency from error handling and replace uses of report_fatal_error(const std::string&) with the Twine() variant which can be forward declared.
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r--llvm/lib/LTO/LTOBackend.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index be16d94..08e45a7 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -255,7 +255,7 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,
// Parse a custom AA pipeline if asked to.
if (!Conf.AAPipeline.empty()) {
if (auto Err = PB.parseAAPipeline(AA, Conf.AAPipeline)) {
- report_fatal_error("unable to parse AA pipeline description '" +
+ report_fatal_error(Twine("unable to parse AA pipeline description '") +
Conf.AAPipeline + "': " + toString(std::move(Err)));
}
} else {
@@ -298,7 +298,7 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,
// Parse a custom pipeline if asked to.
if (!Conf.OptPipeline.empty()) {
if (auto Err = PB.parsePassPipeline(MPM, Conf.OptPipeline)) {
- report_fatal_error("unable to parse pass pipeline description '" +
+ report_fatal_error(Twine("unable to parse pass pipeline description '") +
Conf.OptPipeline + "': " + toString(std::move(Err)));
}
} else if (IsThinLTO) {
@@ -394,8 +394,8 @@ static void codegen(const Config &Conf, TargetMachine *TM,
if (!Conf.DwoDir.empty()) {
std::error_code EC;
if (auto EC = llvm::sys::fs::create_directories(Conf.DwoDir))
- report_fatal_error("Failed to create directory " + Conf.DwoDir + ": " +
- EC.message());
+ report_fatal_error(Twine("Failed to create directory ") + Conf.DwoDir +
+ ": " + EC.message());
DwoFile = Conf.DwoDir;
sys::path::append(DwoFile, std::to_string(Task) + ".dwo");
@@ -407,7 +407,8 @@ static void codegen(const Config &Conf, TargetMachine *TM,
std::error_code EC;
DwoOut = std::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::OF_None);
if (EC)
- report_fatal_error("Failed to open " + DwoFile + ": " + EC.message());
+ report_fatal_error(Twine("Failed to open ") + DwoFile + ": " +
+ EC.message());
}
auto Stream = AddStream(Task);