[Lldb-commits] [lldb] r367368 - [SymbolFilePDB] Fix windows bots after rL367360

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 30 16:48:04 PDT 2019


Author: xiaobai
Date: Tue Jul 30 16:48:03 2019
New Revision: 367368

URL: http://llvm.org/viewvc/llvm-project?rev=367368&view=rev
Log:
[SymbolFilePDB] Fix windows bots after rL367360

SymbolFilePDB tests were using GetTypeSystemForLanguage but weren't
changed to accomodate the use of an llvm::Expected. I adjusted them
accordingly.

Modified:
    lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp?rev=367368&r1=367367&r2=367368&view=diff
==============================================================================
--- lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp (original)
+++ lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Tue Jul 30 16:48:03 2019
@@ -390,8 +390,12 @@ TEST_F(SymbolFilePDBTests, TestNestedCla
   llvm::DenseSet<SymbolFile *> searched_files;
   TypeMap results;
 
-  auto clang_ast_ctx = llvm::dyn_cast_or_null<ClangASTContext>(
-      symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus));
+  auto clang_ast_ctx_or_err =
+      symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);
+  ASSERT_THAT_EXPECTED(clang_ast_ctx_or_err, llvm::Succeeded());
+
+  auto clang_ast_ctx =
+      llvm::dyn_cast_or_null<ClangASTContext>(&clang_ast_ctx_or_err.get());
   EXPECT_NE(nullptr, clang_ast_ctx);
 
   EXPECT_EQ(1u, symfile->FindTypes(ConstString("Class"), nullptr, false, 0,
@@ -440,8 +444,12 @@ TEST_F(SymbolFilePDBTests, TestClassInNa
   llvm::DenseSet<SymbolFile *> searched_files;
   TypeMap results;
 
-  auto clang_ast_ctx = llvm::dyn_cast_or_null<ClangASTContext>(
-      symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus));
+  auto clang_ast_ctx_or_err =
+      symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);
+  ASSERT_THAT_EXPECTED(clang_ast_ctx_or_err, llvm::Succeeded());
+
+  auto clang_ast_ctx =
+      llvm::dyn_cast_or_null<ClangASTContext>(&clang_ast_ctx_or_err.get());
   EXPECT_NE(nullptr, clang_ast_ctx);
 
   auto ast_ctx = clang_ast_ctx->getASTContext();




More information about the lldb-commits mailing list