[llvm] a970065 - [RegisterScavenging] Use a Twine in a call to report_fatal_error instead of going from std::string to c_str. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 8 11:04:44 PDT 2021
Author: Craig Topper
Date: 2021-10-08T11:04:08-07:00
New Revision: a9700653abf2914e0eb4c2996df8786c456c242c
URL: https://github.com/llvm/llvm-project/commit/a9700653abf2914e0eb4c2996df8786c456c242c
DIFF: https://github.com/llvm/llvm-project/commit/a9700653abf2914e0eb4c2996df8786c456c242c.diff
LOG: [RegisterScavenging] Use a Twine in a call to report_fatal_error instead of going from std::string to c_str. NFC
The std::string was built on the line above. Might as well just
build it as a Twine in the call.
Added:
Modified:
llvm/lib/CodeGen/RegisterScavenging.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp
index a55953f82f07..c0a07ec4c91d 100644
--- a/llvm/lib/CodeGen/RegisterScavenging.cpp
+++ b/llvm/lib/CodeGen/RegisterScavenging.cpp
@@ -495,10 +495,11 @@ RegScavenger::spill(Register Reg, const TargetRegisterClass &RC, int SPAdj,
// Spill the scavenged register before \p Before.
int FI = Scavenged[SI].FrameIndex;
if (FI < FIB || FI >= FIE) {
- std::string Msg = std::string("Error while trying to spill ") +
- TRI->getName(Reg) + " from class " + TRI->getRegClassName(&RC) +
- ": Cannot scavenge register without an emergency spill slot!";
- report_fatal_error(Msg.c_str());
+ report_fatal_error(Twine("Error while trying to spill ") +
+ TRI->getName(Reg) + " from class " +
+ TRI->getRegClassName(&RC) +
+ ": Cannot scavenge register without an emergency "
+ "spill slot!");
}
TII->storeRegToStackSlot(*MBB, Before, Reg, true, FI, &RC, TRI);
MachineBasicBlock::iterator II = std::prev(Before);
More information about the llvm-commits
mailing list