mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Format: Modernize using variadic templates.
Introduces a subset of C++14 integer sequences in STLExtras. This is just enough to support unpacking a std::tuple into the arguments of snprintf, we can add more of it when it's actually needed. Also removes an ancient macro hack that leaks a macro into the global namespace. Clean up users that made use of the convenient hack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229337 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -50,7 +50,7 @@ TEST(UseTest, sort) {
|
||||
});
|
||||
unsigned I = 0;
|
||||
for (User *U : X.users()) {
|
||||
snprintf(vnbuf, sizeof(vnbuf), "v%u", I++);
|
||||
format("v%u", I++).snprint(vnbuf, sizeof(vnbuf));
|
||||
EXPECT_EQ(vnbuf, U->getName());
|
||||
}
|
||||
ASSERT_EQ(8u, I);
|
||||
@ -60,7 +60,7 @@ TEST(UseTest, sort) {
|
||||
});
|
||||
I = 0;
|
||||
for (User *U : X.users()) {
|
||||
snprintf(vnbuf, sizeof(vnbuf), "v%u", (7 - I++));
|
||||
format("v%u", (7 - I++)).snprint(vnbuf, sizeof(vnbuf));
|
||||
EXPECT_EQ(vnbuf, U->getName());
|
||||
}
|
||||
ASSERT_EQ(8u, I);
|
||||
@ -95,7 +95,7 @@ TEST(UseTest, reverse) {
|
||||
});
|
||||
unsigned I = 0;
|
||||
for (User *U : X.users()) {
|
||||
snprintf(vnbuf, sizeof(vnbuf), "v%u", I++);
|
||||
format("v%u", I++).snprint(vnbuf, sizeof(vnbuf));
|
||||
EXPECT_EQ(vnbuf, U->getName());
|
||||
}
|
||||
ASSERT_EQ(8u, I);
|
||||
@ -103,7 +103,7 @@ TEST(UseTest, reverse) {
|
||||
X.reverseUseList();
|
||||
I = 0;
|
||||
for (User *U : X.users()) {
|
||||
snprintf(vnbuf, sizeof(vnbuf), "v%u", (7 - I++));
|
||||
format("v%u", (7 - I++)).snprint(vnbuf, sizeof(vnbuf));
|
||||
EXPECT_EQ(vnbuf, U->getName());
|
||||
}
|
||||
ASSERT_EQ(8u, I);
|
||||
|
Reference in New Issue
Block a user