diff options
author | Zachary Turner <zturner@google.com> | 2018-11-05 19:25:39 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-11-05 19:25:39 +0000 |
commit | 115209ece5c55dedf2ce4fb40beca79803c7676e (patch) | |
tree | 6b2e43153992c3180a8109ab55bb1bc3f2b717fe | |
parent | 682ee6c3bc233edd24dd5a20a186313c8815e31e (diff) | |
download | bcm5719-llvm-115209ece5c55dedf2ce4fb40beca79803c7676e.tar.gz bcm5719-llvm-115209ece5c55dedf2ce4fb40beca79803c7676e.zip |
Properly cast from DeclContext to Decl.
Apparently there's a special procedure for doing this. Not
following this silently breaks builds.
llvm-svn: 346156
-rw-r--r-- | lldb/include/lldb/Symbol/ClangASTContext.h | 5 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index 7c8b3c41f46..633d1d88ebe 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -194,10 +194,9 @@ public: 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 ab378cd8cff..12a83da9cb6 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -1285,7 +1285,7 @@ CompilerType ClangASTContext::GetCStringType(bool is_const) { return CompilerType(ast, ast->getPointerType(char_type)); } -clang::TranslationUnitDecl * +clang::DeclContext * ClangASTContext::GetTranslationUnitDecl(clang::ASTContext *ast) { return ast->getTranslationUnitDecl(); } @@ -8966,7 +8966,7 @@ ClangASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type, #define DEPTH_INCREMENT 2 void ClangASTContext::Dump(Stream &s) { - TranslationUnitDecl *tu = GetTranslationUnitDecl(); + Decl *tu = Decl::castFromDeclContext(GetTranslationUnitDecl()); tu->dump(s.AsRawOstream()); } |