From 959e603456f910a7179d54493651ea3ebe740bdd Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 8 Aug 2019 08:22:26 +0000 Subject: [PATCH] Fix PDB unit tests for the GetSymbolVendor deletion llvm-svn: 368265 --- .../SymbolFile/PDB/SymbolFilePDBTests.cpp | 51 +++++++--------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp index 9b4be29..f40e19a 100644 --- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp +++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp @@ -27,7 +27,6 @@ #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/LineTable.h" -#include "lldb/Symbol/SymbolVendor.h" #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/FileSpec.h" @@ -151,9 +150,7 @@ TEST_F(SymbolFilePDBTests, TestAbilitiesForPDB) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); - EXPECT_NE(nullptr, plugin); - SymbolFile *symfile = plugin->GetSymbolFile(); + SymbolFile *symfile = module->GetSymbolFile(); EXPECT_NE(nullptr, symfile); EXPECT_EQ(symfile->GetPluginName(), SymbolFilePDB::GetPluginNameStatic()); @@ -169,9 +166,7 @@ TEST_F(SymbolFilePDBTests, TestResolveSymbolContextBasename) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); - EXPECT_NE(nullptr, plugin); - SymbolFile *symfile = plugin->GetSymbolFile(); + SymbolFile *symfile = module->GetSymbolFile(); FileSpec header_spec("test-pdb.cpp"); SymbolContextList sc_list; @@ -189,9 +184,7 @@ TEST_F(SymbolFilePDBTests, TestResolveSymbolContextFullPath) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); - EXPECT_NE(nullptr, plugin); - SymbolFile *symfile = plugin->GetSymbolFile(); + SymbolFile *symfile = module->GetSymbolFile(); FileSpec header_spec( R"spec(D:\src\llvm\tools\lldb\unittests\SymbolFile\PDB\Inputs\test-pdb.cpp)spec"); @@ -212,9 +205,7 @@ TEST_F(SymbolFilePDBTests, TestLookupOfHeaderFileWithInlines) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); - EXPECT_NE(nullptr, plugin); - SymbolFile *symfile = plugin->GetSymbolFile(); + SymbolFile *symfile = module->GetSymbolFile(); FileSpec header_specs[] = {FileSpec("test-pdb.h"), FileSpec("test-pdb-nested.h")}; @@ -240,9 +231,7 @@ TEST_F(SymbolFilePDBTests, TestLookupOfHeaderFileWithNoInlines) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); - EXPECT_NE(nullptr, plugin); - SymbolFile *symfile = plugin->GetSymbolFile(); + SymbolFile *symfile = module->GetSymbolFile(); FileSpec header_specs[] = {FileSpec("test-pdb.h"), FileSpec("test-pdb-nested.h")}; @@ -262,8 +251,7 @@ TEST_F(SymbolFilePDBTests, TestLineTablesMatchAll) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); - SymbolFile *symfile = plugin->GetSymbolFile(); + SymbolFile *symfile = module->GetSymbolFile(); FileSpec source_file("test-pdb.cpp"); FileSpec header1("test-pdb.h"); @@ -312,8 +300,7 @@ TEST_F(SymbolFilePDBTests, TestLineTablesMatchSpecific) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); - SymbolFile *symfile = plugin->GetSymbolFile(); + SymbolFile *symfile = module->GetSymbolFile(); FileSpec source_file("test-pdb.cpp"); FileSpec header1("test-pdb.h"); @@ -362,9 +349,8 @@ TEST_F(SymbolFilePDBTests, TestSimpleClassTypes) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = - static_cast(plugin->GetSymbolFile()); + static_cast(module->GetSymbolFile()); llvm::pdb::IPDBSession &session = symfile->GetPDBSession(); llvm::DenseSet searched_files; TypeMap results; @@ -384,9 +370,8 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = - static_cast(plugin->GetSymbolFile()); + static_cast(module->GetSymbolFile()); llvm::pdb::IPDBSession &session = symfile->GetPDBSession(); llvm::DenseSet searched_files; TypeMap results; @@ -438,9 +423,8 @@ TEST_F(SymbolFilePDBTests, TestClassInNamespace) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = - static_cast(plugin->GetSymbolFile()); + static_cast(module->GetSymbolFile()); llvm::pdb::IPDBSession &session = symfile->GetPDBSession(); llvm::DenseSet searched_files; TypeMap results; @@ -484,9 +468,8 @@ TEST_F(SymbolFilePDBTests, TestEnumTypes) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = - static_cast(plugin->GetSymbolFile()); + static_cast(module->GetSymbolFile()); llvm::pdb::IPDBSession &session = symfile->GetPDBSession(); llvm::DenseSet searched_files; const char *EnumsToCheck[] = {"Enum", "ShortEnum"}; @@ -530,9 +513,8 @@ TEST_F(SymbolFilePDBTests, TestTypedefs) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = - static_cast(plugin->GetSymbolFile()); + static_cast(module->GetSymbolFile()); llvm::pdb::IPDBSession &session = symfile->GetPDBSession(); llvm::DenseSet searched_files; TypeMap results; @@ -565,9 +547,8 @@ TEST_F(SymbolFilePDBTests, TestRegexNameMatch) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = - static_cast(plugin->GetSymbolFile()); + static_cast(module->GetSymbolFile()); TypeMap results; symfile->FindTypesByRegex(RegularExpression(".*"), 0, results); @@ -584,9 +565,8 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = - static_cast(plugin->GetSymbolFile()); + static_cast(module->GetSymbolFile()); llvm::DenseSet searched_files; TypeMap results; const ConstString name("ClassTypedef"); @@ -611,9 +591,8 @@ TEST_F(SymbolFilePDBTests, TestNullName) { ArchSpec aspec("i686-pc-windows"); lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = - static_cast(plugin->GetSymbolFile()); + static_cast(module->GetSymbolFile()); llvm::DenseSet searched_files; TypeMap results; uint32_t num_results = symfile->FindTypes(ConstString(), nullptr, false, 0, -- 2.7.4