Index: include/lld/Core/InputGraph.h =================================================================== --- include/lld/Core/InputGraph.h +++ include/lld/Core/InputGraph.h @@ -242,8 +242,7 @@ /// \brief create an error string for printing purposes virtual std::string errStr(std::error_code errc) { std::string msg = errc.message(); - Twine twine = Twine("Cannot open ") + _path + ": " + msg; - return twine.str(); + return (Twine("Cannot open ") + _path + ": " + msg).str(); } /// \brief Get the list of files Index: lib/Passes/LayoutPass.cpp =================================================================== --- lib/Passes/LayoutPass.cpp +++ lib/Passes/LayoutPass.cpp @@ -26,9 +26,8 @@ #ifndef NDEBUG // Return "reason (leftval, rightval)" static std::string formatReason(StringRef reason, int leftVal, int rightVal) { - Twine msg = - Twine(reason) + " (" + Twine(leftVal) + ", " + Twine(rightVal) + ")"; - return msg.str(); + return (Twine(reason) + " (" + Twine(leftVal) + ", " + Twine(rightVal) + ")") + .str(); } // Less-than relationship of two atoms must be transitive, which is, if a < b @@ -107,17 +106,19 @@ if (!atom) return; auto i = followOnRoots.find(atom); if (i == followOnRoots.end()) { - Twine msg(Twine("Atom <") + atomToDebugString(atom) - + "> has no follow-on root!"); - llvm_unreachable(msg.str().c_str()); + llvm_unreachable(((Twine("Atom <") + atomToDebugString(atom) + + "> has no follow-on root!")) + .str() + .c_str()); } const DefinedAtom *ap = i->second; while (true) { const DefinedAtom *next = followOnRoots[ap]; if (!next) { - Twine msg(Twine("Atom <" + atomToDebugString(atom) - + "> is not reachable from its root!")); - llvm_unreachable(msg.str().c_str()); + llvm_unreachable((Twine("Atom <" + atomToDebugString(atom) + + "> is not reachable from its root!")) + .str() + .c_str()); } if (next == ap) return;