diff options
author | Rui Ueyama <ruiu@google.com> | 2014-09-24 00:09:36 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2014-09-24 00:09:36 +0000 |
commit | 75c0127bb3916e9f76bd0f003aebc22d2d4ac93a (patch) | |
tree | 0659af5f457d34225b4d7c140e64b2e110e92230 /lld/unittests/DriverTests/WinLinkDriverTest.cpp | |
parent | 7ea46bab26f76c3016f9c9aecf11ae9d72c1b1d4 (diff) | |
download | bcm5719-llvm-75c0127bb3916e9f76bd0f003aebc22d2d4ac93a.tar.gz bcm5719-llvm-75c0127bb3916e9f76bd0f003aebc22d2d4ac93a.zip |
[PECOFF] Change export table type.
This patch changes the type of export table set from std::set to
std::vector. The new code is slightly inefficient, but because
export table elements are actually mutable, std::vector is better
here. No functionality change.
llvm-svn: 218343
Diffstat (limited to 'lld/unittests/DriverTests/WinLinkDriverTest.cpp')
-rw-r--r-- | lld/unittests/DriverTests/WinLinkDriverTest.cpp | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/lld/unittests/DriverTests/WinLinkDriverTest.cpp b/lld/unittests/DriverTests/WinLinkDriverTest.cpp index 7ce513cc030..62835b6c8f3 100644 --- a/lld/unittests/DriverTests/WinLinkDriverTest.cpp +++ b/lld/unittests/DriverTests/WinLinkDriverTest.cpp @@ -158,43 +158,39 @@ TEST_F(WinLinkParserTest, AlternateName) { TEST_F(WinLinkParserTest, Export) { EXPECT_TRUE(parse("link.exe", "/export:foo", "a.out", nullptr)); - const std::set<PECOFFLinkingContext::ExportDesc> &exports = + const std::vector<PECOFFLinkingContext::ExportDesc> &exports = _context.getDllExports(); EXPECT_EQ(1U, exports.size()); - auto it = exports.begin(); - EXPECT_EQ("_foo", it->name); - EXPECT_EQ(-1, it->ordinal); - EXPECT_FALSE(it->noname); - EXPECT_FALSE(it->isData); + EXPECT_EQ("_foo", exports[0].name); + EXPECT_EQ(-1, exports[0].ordinal); + EXPECT_FALSE(exports[0].noname); + EXPECT_FALSE(exports[0].isData); } TEST_F(WinLinkParserTest, ExportWithOptions) { EXPECT_TRUE(parse("link.exe", "/export:foo,@8,noname,data", "/export:bar,@10,data", "a.out", nullptr)); - const std::set<PECOFFLinkingContext::ExportDesc> &exports = + const std::vector<PECOFFLinkingContext::ExportDesc> &exports = _context.getDllExports(); EXPECT_EQ(2U, exports.size()); - auto it = exports.begin(); - EXPECT_EQ("_bar", it->name); - EXPECT_EQ(10, it->ordinal); - EXPECT_FALSE(it->noname); - EXPECT_TRUE(it->isData); - ++it; - EXPECT_EQ("_foo", it->name); - EXPECT_EQ(8, it->ordinal); - EXPECT_TRUE(it->noname); - EXPECT_TRUE(it->isData); + EXPECT_EQ("_foo", exports[0].name); + EXPECT_EQ(8, exports[0].ordinal); + EXPECT_TRUE(exports[0].noname); + EXPECT_TRUE(exports[0].isData); + EXPECT_EQ("_bar", exports[1].name); + EXPECT_EQ(10, exports[1].ordinal); + EXPECT_FALSE(exports[1].noname); + EXPECT_TRUE(exports[1].isData); } TEST_F(WinLinkParserTest, ExportDuplicateExports) { EXPECT_TRUE( parse("link.exe", "/export:foo", "/export:foo,@2", "a.out", nullptr)); - const std::set<PECOFFLinkingContext::ExportDesc> &exports = + const std::vector<PECOFFLinkingContext::ExportDesc> &exports = _context.getDllExports(); EXPECT_EQ(1U, exports.size()); - auto it = exports.begin(); - EXPECT_EQ("_foo", it->name); - EXPECT_EQ(-1, it->ordinal); + EXPECT_EQ("_foo", exports[0].name); + EXPECT_EQ(-1, exports[0].ordinal); } TEST_F(WinLinkParserTest, ExportDuplicateOrdinals) { |