[llvm] 0b15cb7 - [TextAPI] clean up auto usages in tests, NFC
Cyndy Ishida via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 21 08:41:48 PDT 2020
Author: Cyndy Ishida
Date: 2020-09-21T08:39:40-07:00
New Revision: 0b15cb70d318255814c0614a978b6920ba075fa2
URL: https://github.com/llvm/llvm-project/commit/0b15cb70d318255814c0614a978b6920ba075fa2
DIFF: https://github.com/llvm/llvm-project/commit/0b15cb70d318255814c0614a978b6920ba075fa2.diff
LOG: [TextAPI] clean up auto usages in tests, NFC
Added:
Modified:
llvm/unittests/TextAPI/TextStubHelpers.h
llvm/unittests/TextAPI/TextStubV3Tests.cpp
llvm/unittests/TextAPI/TextStubV4Tests.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/TextAPI/TextStubHelpers.h b/llvm/unittests/TextAPI/TextStubHelpers.h
index 315b7d3a4b5d..cf93504a9a06 100644
--- a/llvm/unittests/TextAPI/TextStubHelpers.h
+++ b/llvm/unittests/TextAPI/TextStubHelpers.h
@@ -25,6 +25,7 @@ struct ExportedSymbol {
using ExportedSymbolSeq = std::vector<ExportedSymbol>;
using UUIDs = std::vector<std::pair<llvm::MachO::Target, std::string>>;
using TBDFile = std::unique_ptr<MachO::InterfaceFile>;
+using TBDReexportFile = std::shared_ptr<MachO::InterfaceFile>;
inline bool operator<(const ExportedSymbol &LHS, const ExportedSymbol &RHS) {
return std::tie(LHS.Kind, LHS.Name) < std::tie(RHS.Kind, RHS.Name);
diff --git a/llvm/unittests/TextAPI/TextStubV3Tests.cpp b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
index 2a9de7adbc6a..a6a88c43c478 100644
--- a/llvm/unittests/TextAPI/TextStubV3Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
@@ -211,7 +211,7 @@ TEST(TBDv3, ReadMultipleDocuments) {
// Check Second Document
Exports.clear();
- auto Document = File->documents().front();
+ TBDReexportFile Document = File->documents().front();
EXPECT_EQ(FileType::TBD_V3, Document->getFileType());
EXPECT_EQ(Archs, Document->getArchitectures());
EXPECT_EQ(Uuids, Document->uuids());
diff --git a/llvm/unittests/TextAPI/TextStubV4Tests.cpp b/llvm/unittests/TextAPI/TextStubV4Tests.cpp
index d4b2ef623eac..43b53e197f0f 100644
--- a/llvm/unittests/TextAPI/TextStubV4Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV4Tests.cpp
@@ -277,7 +277,7 @@ TEST(TBDv4, ReadMultipleDocuments) {
{Targets[1], "21111111-1111-1111-1111-111111111111"},
};
- auto Document = File->documents().front();
+ TBDReexportFile Document = File->documents().front();
EXPECT_EQ(FileType::TBD_V4, Document->getFileType());
EXPECT_EQ(Archs, Document->getArchitectures());
EXPECT_EQ(Uuids, Document->uuids());
@@ -505,7 +505,7 @@ TEST(TBDv4, MultipleTargets) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4MultipleTargets),
stripWhitespace(Buffer.c_str()));
@@ -534,7 +534,7 @@ TEST(TBDv4, MultipleTargetsSameArch) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4TargetsSameArch),
stripWhitespace(Buffer.c_str()));
@@ -559,7 +559,7 @@ TEST(TBDv4, MultipleTargetsSamePlatform) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4MultipleTargetsSamePlatform),
stripWhitespace(Buffer.c_str()));
@@ -584,7 +584,7 @@ TEST(TBDv4, Target_maccatalyst) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4TargetMacCatalyst),
stripWhitespace(Buffer.c_str()));
@@ -608,7 +608,7 @@ TEST(TBDv4, Target_x86_ios) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4Targetx86iOS),
stripWhitespace(Buffer.c_str()));
@@ -632,7 +632,7 @@ TEST(TBDv4, Target_arm_bridgeOS) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4PlatformBridgeOS),
stripWhitespace(Buffer.c_str()));
@@ -656,7 +656,7 @@ TEST(TBDv4, Target_arm_iOS) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4ArchArm64e), stripWhitespace(Buffer.c_str()));
}
@@ -679,7 +679,7 @@ TEST(TBDv4, Target_x86_macos) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4Targetx86MacOS),
stripWhitespace(Buffer.c_str()));
@@ -704,7 +704,7 @@ TEST(TBDv4, Target_x86_ios_simulator) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4Targetx86iOSSim),
stripWhitespace(Buffer.c_str()));
@@ -728,7 +728,7 @@ TEST(TBDv4, Target_x86_tvos_simulator) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4x86tvOSSim), stripWhitespace(Buffer.c_str()));
}
@@ -752,7 +752,7 @@ TEST(TBDv4, Target_i386_watchos_simulator) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4i386watchOSSim),
stripWhitespace(Buffer.c_str()));
@@ -776,7 +776,7 @@ TEST(TBDv4, Target_i386_driverkit) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4i386DriverKit),
stripWhitespace(Buffer.c_str()));
@@ -835,7 +835,7 @@ TEST(TBDv4, Swift_5) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4SwiftVersion5),
stripWhitespace(Buffer.c_str()));
@@ -858,7 +858,7 @@ TEST(TBDv4, Swift_99) {
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
- auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
+ Error WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv4SwiftVersion99),
stripWhitespace(Buffer.c_str()));
More information about the llvm-commits
mailing list