summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/Symbol/ClangASTContext.h6
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp8
2 files changed, 3 insertions, 11 deletions
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h
index 29d85211cd8..c2c3726e48b 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -167,10 +167,8 @@ public:
uint32_t GetPointerByteSize() override;
- static clang::DeclContext *GetTranslationUnitDecl(clang::ASTContext *ast);
-
- clang::DeclContext *GetTranslationUnitDecl() {
- return GetTranslationUnitDecl(&getASTContext());
+ clang::TranslationUnitDecl *GetTranslationUnitDecl() {
+ return getASTContext().getTranslationUnitDecl();
}
static clang::Decl *CopyDecl(clang::ASTContext *dest_context,
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 58ff82dbeb8..f86e4bcd06a 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -1153,11 +1153,6 @@ CompilerType ClangASTContext::GetCStringType(bool is_const) {
return CompilerType(this, ast.getPointerType(char_type).getAsOpaquePtr());
}
-clang::DeclContext *
-ClangASTContext::GetTranslationUnitDecl(clang::ASTContext *ast) {
- return ast->getTranslationUnitDecl();
-}
-
clang::Decl *ClangASTContext::CopyDecl(ASTContext *dst_ast, ASTContext *src_ast,
clang::Decl *source_decl) {
FileSystemOptions file_system_options;
@@ -1782,8 +1777,7 @@ clang::DeclContext *FindLCABetweenDecls(clang::DeclContext *left,
clang::UsingDirectiveDecl *ClangASTContext::CreateUsingDirectiveDeclaration(
clang::DeclContext *decl_ctx, clang::NamespaceDecl *ns_decl) {
if (decl_ctx != nullptr && ns_decl != nullptr) {
- clang::TranslationUnitDecl *translation_unit =
- (clang::TranslationUnitDecl *)GetTranslationUnitDecl(&getASTContext());
+ auto *translation_unit = getASTContext().getTranslationUnitDecl();
clang::UsingDirectiveDecl *using_decl = clang::UsingDirectiveDecl::Create(
getASTContext(), decl_ctx, clang::SourceLocation(),
clang::SourceLocation(), clang::NestedNameSpecifierLoc(),
OpenPOWER on IntegriCloud