Skip to content

Commit 5edd684

Browse files
committed
[compiler-rt] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368946
1 parent 708c460 commit 5edd684

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

compiler-rt/lib/xray/tests/unit/fdr_controller_test.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ class FunctionSequenceTest : public ::testing::Test {
5151
public:
5252
void SetUp() override {
5353
bool Success;
54-
BQ = llvm::make_unique<BufferQueue>(4096, 1, Success);
54+
BQ = std::make_unique<BufferQueue>(4096, 1, Success);
5555
ASSERT_TRUE(Success);
5656
ASSERT_EQ(BQ->getBuffer(B), BufferQueue::ErrorCode::Ok);
57-
W = llvm::make_unique<FDRLogWriter>(B);
58-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 0);
57+
W = std::make_unique<FDRLogWriter>(B);
58+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 0);
5959
}
6060
};
6161

@@ -103,7 +103,7 @@ TEST_F(FunctionSequenceTest, BoundaryFuncIdEncoding) {
103103
}
104104

105105
TEST_F(FunctionSequenceTest, ThresholdsAreEnforced) {
106-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
106+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
107107
ASSERT_TRUE(C->functionEnter(1, 2, 3));
108108
ASSERT_TRUE(C->functionExit(1, 2, 3));
109109
ASSERT_TRUE(C->flush());
@@ -118,7 +118,7 @@ TEST_F(FunctionSequenceTest, ThresholdsAreEnforced) {
118118
}
119119

120120
TEST_F(FunctionSequenceTest, ArgsAreHandledAndKept) {
121-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
121+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
122122
ASSERT_TRUE(C->functionEnterArg(1, 2, 3, 4));
123123
ASSERT_TRUE(C->functionExit(1, 2, 3));
124124
ASSERT_TRUE(C->flush());
@@ -138,7 +138,7 @@ TEST_F(FunctionSequenceTest, ArgsAreHandledAndKept) {
138138
}
139139

140140
TEST_F(FunctionSequenceTest, PreservedCallsHaveCorrectTSC) {
141-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
141+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
142142
uint64_t TSC = 1;
143143
uint16_t CPU = 0;
144144
ASSERT_TRUE(C->functionEnter(1, TSC++, CPU));
@@ -163,7 +163,7 @@ TEST_F(FunctionSequenceTest, PreservedCallsHaveCorrectTSC) {
163163
}
164164

165165
TEST_F(FunctionSequenceTest, PreservedCallsSupportLargeDeltas) {
166-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
166+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
167167
uint64_t TSC = 1;
168168
uint16_t CPU = 0;
169169
const auto LargeDelta = uint64_t{std::numeric_limits<int32_t>::max()};
@@ -187,7 +187,7 @@ TEST_F(FunctionSequenceTest, PreservedCallsSupportLargeDeltas) {
187187
}
188188

189189
TEST_F(FunctionSequenceTest, RewindingMultipleCalls) {
190-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
190+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
191191

192192
// First we construct an arbitrarily deep function enter/call stack.
193193
// We also ensure that we are in the same CPU.
@@ -214,7 +214,7 @@ TEST_F(FunctionSequenceTest, RewindingMultipleCalls) {
214214
}
215215

216216
TEST_F(FunctionSequenceTest, RewindingIntermediaryTailExits) {
217-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
217+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
218218

219219
// First we construct an arbitrarily deep function enter/call stack.
220220
// We also ensure that we are in the same CPU.
@@ -248,7 +248,7 @@ TEST_F(FunctionSequenceTest, RewindingIntermediaryTailExits) {
248248
}
249249

250250
TEST_F(FunctionSequenceTest, RewindingAfterMigration) {
251-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
251+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 1000);
252252

253253
// First we construct an arbitrarily deep function enter/call stack.
254254
// We also ensure that we are in the same CPU.
@@ -303,13 +303,13 @@ class BufferManagementTest : public ::testing::Test {
303303
public:
304304
void SetUp() override {
305305
bool Success;
306-
BQ = llvm::make_unique<BufferQueue>(sizeof(MetadataRecord) * 5 +
306+
BQ = std::make_unique<BufferQueue>(sizeof(MetadataRecord) * 5 +
307307
sizeof(FunctionRecord) * 2,
308308
kBuffers, Success);
309309
ASSERT_TRUE(Success);
310310
ASSERT_EQ(BQ->getBuffer(B), BufferQueue::ErrorCode::Ok);
311-
W = llvm::make_unique<FDRLogWriter>(B);
312-
C = llvm::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 0);
311+
W = std::make_unique<FDRLogWriter>(B);
312+
C = std::make_unique<FDRController<>>(BQ.get(), B, *W, clock_gettime, 0);
313313
}
314314
};
315315

0 commit comments

Comments
 (0)