Skip to content

Commit 164055f

Browse files
authored
Revert "[Support] Introduce formatv variant of createStringError" (#82126)
Reverts #80493 This increased clang compile times by 0.5%. I'll figure out a less expensive way to achieve this.
1 parent 21ddd7f commit 164055f

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

llvm/include/llvm/Support/Error.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "llvm/Support/ErrorHandling.h"
2323
#include "llvm/Support/ErrorOr.h"
2424
#include "llvm/Support/Format.h"
25-
#include "llvm/Support/FormatVariadic.h"
2625
#include "llvm/Support/raw_ostream.h"
2726
#include <cassert>
2827
#include <cstdint>
@@ -1262,15 +1261,6 @@ inline Error createStringError(std::errc EC, char const *Fmt,
12621261
return createStringError(std::make_error_code(EC), Fmt, Vals...);
12631262
}
12641263

1265-
template <typename... Ts>
1266-
inline Error createStringErrorV(std::error_code EC, const char *Fmt,
1267-
const Ts &...Vals) {
1268-
std::string Buffer;
1269-
raw_string_ostream Stream(Buffer);
1270-
Stream << formatv(Fmt, Vals...);
1271-
return make_error<StringError>(Stream.str(), EC);
1272-
}
1273-
12741264
/// This class wraps a filename and another Error.
12751265
///
12761266
/// In some cases, an error needs to live along a 'source' name, in order to

llvm/unittests/Support/ErrorTest.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -472,23 +472,6 @@ TEST(Error, createStringError) {
472472
<< "Failed to convert createStringError() result to error_code.";
473473
}
474474

475-
TEST(Error, createStringErrorV) {
476-
static llvm::StringRef Bar("bar");
477-
static const std::error_code EC = errc::invalid_argument;
478-
std::string Msg;
479-
raw_string_ostream S(Msg);
480-
logAllUnhandledErrors(createStringErrorV(EC, "foo{0}{1}{2:x}", Bar, 1, 0xff),
481-
S);
482-
EXPECT_EQ(S.str(), "foobar10xff\n")
483-
<< "Unexpected createStringErrorV() log result";
484-
485-
S.flush();
486-
Msg.clear();
487-
auto Res = errorToErrorCode(createStringErrorV(EC, "foo{0}", Bar));
488-
EXPECT_EQ(Res, EC)
489-
<< "Failed to convert createStringErrorV() result to error_code.";
490-
}
491-
492475
// Test that the ExitOnError utility works as expected.
493476
TEST(ErrorDeathTest, ExitOnError) {
494477
ExitOnError ExitOnErr;

0 commit comments

Comments
 (0)