Properly cast from DeclContext to Decl.
Apparently there's a special procedure for doing this. Not
following this silently breaks builds.
llvm-svn: 346156
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h
index 7c8b3c4..633d1d8 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -194,10 +194,9 @@
uint32_t GetPointerByteSize() override;
- static clang::TranslationUnitDecl *
- GetTranslationUnitDecl(clang::ASTContext *ast);
+ static clang::DeclContext *GetTranslationUnitDecl(clang::ASTContext *ast);
- clang::TranslationUnitDecl *GetTranslationUnitDecl() {
+ clang::DeclContext *GetTranslationUnitDecl() {
return GetTranslationUnitDecl(getASTContext());
}
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index ab378cd..12a83da 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -1285,7 +1285,7 @@
return CompilerType(ast, ast->getPointerType(char_type));
}
-clang::TranslationUnitDecl *
+clang::DeclContext *
ClangASTContext::GetTranslationUnitDecl(clang::ASTContext *ast) {
return ast->getTranslationUnitDecl();
}
@@ -8966,7 +8966,7 @@
#define DEPTH_INCREMENT 2
void ClangASTContext::Dump(Stream &s) {
- TranslationUnitDecl *tu = GetTranslationUnitDecl();
+ Decl *tu = Decl::castFromDeclContext(GetTranslationUnitDecl());
tu->dump(s.AsRawOstream());
}