Skip to content

Commit f6fa95b

Browse files
committed
[Support] ErrorHandling.h - Remove report_fatal_error(std::string)
As described on D111049, removing the <string> dependency from error handling removes considerable build overhead, its recommended that the report_fatal_error(Twine) variant is used instead.
1 parent 92128b7 commit f6fa95b

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

llvm/include/llvm/Support/ErrorHandling.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#define LLVM_SUPPORT_ERRORHANDLING_H
1616

1717
#include "llvm/Support/Compiler.h"
18-
#include <string>
1918

2019
namespace llvm {
2120
class StringRef;
@@ -68,10 +67,9 @@ namespace llvm {
6867
/// standard error, followed by a newline.
6968
/// After the error handler is called this function will call abort(), it
7069
/// does not return.
70+
/// NOTE: The std::string variant was removed to avoid a <string> dependency.
7171
[[noreturn]] void report_fatal_error(const char *reason,
7272
bool gen_crash_diag = true);
73-
[[noreturn]] void report_fatal_error(const std::string &reason,
74-
bool gen_crash_diag = true);
7573
[[noreturn]] void report_fatal_error(StringRef reason,
7674
bool gen_crash_diag = true);
7775
[[noreturn]] void report_fatal_error(const Twine &reason,

llvm/lib/Support/ErrorHandling.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ void llvm::report_fatal_error(const char *Reason, bool GenCrashDiag) {
8383
report_fatal_error(Twine(Reason), GenCrashDiag);
8484
}
8585

86-
void llvm::report_fatal_error(const std::string &Reason, bool GenCrashDiag) {
87-
report_fatal_error(Twine(Reason), GenCrashDiag);
88-
}
89-
9086
void llvm::report_fatal_error(StringRef Reason, bool GenCrashDiag) {
9187
report_fatal_error(Twine(Reason), GenCrashDiag);
9288
}

0 commit comments

Comments
 (0)