[llvm] Unix.h - Replace report_fatal_error(std::string) with report_fatal_error(Twine)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 6 Oct 2021 11:13:40 +0000 (12:13 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 6 Oct 2021 11:13:40 +0000 (12:13 +0100)
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.

llvm/lib/Support/Unix/Unix.h

index e392434..1599241 100644 (file)
@@ -70,7 +70,7 @@ static inline bool MakeErrMsg(
 [[noreturn]] static inline void ReportErrnumFatal(const char *Msg, int errnum) {
   std::string ErrMsg;
   MakeErrMsg(&ErrMsg, Msg, errnum);
-  llvm::report_fatal_error(ErrMsg);
+  llvm::report_fatal_error(llvm::Twine(ErrMsg));
 }
 
 namespace llvm {