[Lldb-commits] [lldb] 7d13812 - [lldb] Fix compilation of SymbolFilePDBTests.cpp after FindTypes API change
Raphael Isemann via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 18 01:52:41 PST 2020
Author: Raphael Isemann
Date: 2020-02-18T10:52:02+01:00
New Revision: 7d13812329ba8aadebc27f30613e79b0ca1bec5f
URL: https://github.com/llvm/llvm-project/commit/7d13812329ba8aadebc27f30613e79b0ca1bec5f
DIFF: https://github.com/llvm/llvm-project/commit/7d13812329ba8aadebc27f30613e79b0ca1bec5f.diff
LOG: [lldb] Fix compilation of SymbolFilePDBTests.cpp after FindTypes API change
Since f9568a95493aea3ea813bd37cb8c084ec4294e38 this function takes a
CompilerDeclContext reference instead of a pointer.
Added:
Modified:
lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
Removed:
################################################################################
diff --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
index 880daaee056b..44f77ef0044f 100644
--- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -355,7 +355,8 @@ TEST_F(SymbolFilePDBTests, TestSimpleClassTypes) {
llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
- symfile->FindTypes(ConstString("Class"), nullptr, 0, searched_files, results);
+ symfile->FindTypes(ConstString("Class"), CompilerDeclContext(), 0,
+ searched_files, results);
EXPECT_EQ(1u, results.GetSize());
lldb::TypeSP udt_type = results.GetTypeAtIndex(0);
EXPECT_EQ(ConstString("Class"), udt_type->GetName());
@@ -384,7 +385,8 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
llvm::dyn_cast_or_null<TypeSystemClang>(&clang_ast_ctx_or_err.get());
EXPECT_NE(nullptr, clang_ast_ctx);
- symfile->FindTypes(ConstString("Class"), nullptr, 0, searched_files, results);
+ symfile->FindTypes(ConstString("Class"), CompilerDeclContext(), 0,
+ searched_files, results);
EXPECT_EQ(1u, results.GetSize());
auto Class = results.GetTypeAtIndex(0);
@@ -404,7 +406,7 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
TypeMap more_results;
auto ClassCompilerDeclCtx = CompilerDeclContext(clang_ast_ctx, ClassDeclCtx);
- symfile->FindTypes(ConstString("NestedClass"), &ClassCompilerDeclCtx, 0,
+ symfile->FindTypes(ConstString("NestedClass"), ClassCompilerDeclCtx, 0,
searched_files, more_results);
EXPECT_LE(1u, more_results.GetSize());
@@ -448,7 +450,7 @@ TEST_F(SymbolFilePDBTests, TestClassInNamespace) {
auto ns_namespace = symfile->FindNamespace(ConstString("NS"), nullptr);
EXPECT_TRUE(ns_namespace.IsValid());
- symfile->FindTypes(ConstString("NSClass"), &ns_namespace, 0, searched_files,
+ symfile->FindTypes(ConstString("NSClass"), ns_namespace, 0, searched_files,
results);
EXPECT_EQ(1u, results.GetSize());
@@ -474,7 +476,8 @@ TEST_F(SymbolFilePDBTests, TestEnumTypes) {
const char *EnumsToCheck[] = {"Enum", "ShortEnum"};
for (auto Enum : EnumsToCheck) {
TypeMap results;
- symfile->FindTypes(ConstString(Enum), nullptr, 0, searched_files, results);
+ symfile->FindTypes(ConstString(Enum), CompilerDeclContext(), 0,
+ searched_files, results);
EXPECT_EQ(1u, results.GetSize());
lldb::TypeSP enum_type = results.GetTypeAtIndex(0);
EXPECT_EQ(ConstString(Enum), enum_type->GetName());
@@ -522,8 +525,8 @@ TEST_F(SymbolFilePDBTests, TestTypedefs) {
"VariadicFuncPointerTypedef"};
for (auto Typedef : TypedefsToCheck) {
TypeMap results;
- symfile->FindTypes(ConstString(Typedef), nullptr, 0, searched_files,
- results);
+ symfile->FindTypes(ConstString(Typedef), CompilerDeclContext(), 0,
+ searched_files, results);
EXPECT_EQ(1u, results.GetSize());
lldb::TypeSP typedef_type = results.GetTypeAtIndex(0);
EXPECT_EQ(ConstString(Typedef), typedef_type->GetName());
@@ -568,7 +571,7 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
const ConstString name("ClassTypedef");
- symfile->FindTypes(name, nullptr, 0, searched_files, results);
+ symfile->FindTypes(name, CompilerDeclContext(), 0, searched_files, results);
// Try to limit ourselves from 1 to 10 results, otherwise we could
// be doing this thousands of times. The idea is just to make sure
// that for a variety of values, the number of limited results
@@ -577,7 +580,8 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
uint32_t iterations = std::min(num_results, 10u);
for (uint32_t i = 1; i <= iterations; ++i) {
TypeMap more_results;
- symfile->FindTypes(name, nullptr, i, searched_files, more_results);
+ symfile->FindTypes(name, CompilerDeclContext(), i, searched_files,
+ more_results);
uint32_t num_limited_results = more_results.GetSize();
EXPECT_EQ(i, num_limited_results);
}
@@ -592,7 +596,8 @@ TEST_F(SymbolFilePDBTests, TestNullName) {
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
- symfile->FindTypes(ConstString(), nullptr, 0, searched_files, results);
+ symfile->FindTypes(ConstString(), CompilerDeclContext(), 0, searched_files,
+ results);
EXPECT_EQ(0u, results.GetSize());
}
More information about the lldb-commits
mailing list