diff options
author | Zachary Turner <zturner@google.com> | 2016-03-28 22:53:41 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-03-28 22:53:41 +0000 |
commit | d133f6acf14ab84e364baa55ebe3aafecd0451d0 (patch) | |
tree | 3b12690da0ab37bcfa209584525b86049fe28064 /lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp | |
parent | ecabac6244f67c477ae2e8f71c41bb12d35e42be (diff) | |
download | bcm5719-llvm-d133f6acf14ab84e364baa55ebe3aafecd0451d0.tar.gz bcm5719-llvm-d133f6acf14ab84e364baa55ebe3aafecd0451d0.zip |
Move some functions from DWARFASTParserClang to ClangASTImporter.
This allows these functions to be re-used by a forthcoming
PDBASTParser. The functions in question are CanCompleteType,
CompleteType, and CanImport. Conceptually, these functions belong
on ClangASTImporter anyway, and previously they were just ping
ponging around through a few levels of indirection to end up there
as well, so this patch actually makes the code somewhat simpler.
A few methods were moved to a new file called ClangUtil, so that
they can be shared between ClangASTImporter and ClangASTContext
without creating a circular dependency between those two cpp
files.
Differential Revision: http://reviews.llvm.org/D18381
llvm-svn: 264685
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp')
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index 7d8cedf6845..7a3b16e0b31 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -12,12 +12,11 @@ #include "ASTDumper.h" #include "ClangModulesDeclVendor.h" -#include "clang/AST/ASTContext.h" -#include "clang/AST/RecordLayout.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Symbol/ClangASTContext.h" +#include "lldb/Symbol/ClangUtil.h" #include "lldb/Symbol/CompilerDeclContext.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/SymbolFile.h" @@ -25,6 +24,8 @@ #include "lldb/Symbol/TaggedASTType.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" +#include "clang/AST/ASTContext.h" +#include "clang/AST/RecordLayout.h" #include <vector> @@ -277,7 +278,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl) if (!clang_type) continue; - const TagType *tag_type = ClangASTContext::GetQualType(clang_type)->getAs<TagType>(); + const TagType *tag_type = ClangUtil::GetQualType(clang_type)->getAs<TagType>(); if (!tag_type) continue; @@ -317,7 +318,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl) if (!clang_type) continue; - const TagType *tag_type = ClangASTContext::GetQualType(clang_type)->getAs<TagType>(); + const TagType *tag_type = ClangUtil::GetQualType(clang_type)->getAs<TagType>(); if (!tag_type) continue; @@ -1905,7 +1906,8 @@ ClangASTSource::GuardedCopyType (const CompilerType &src_type) SetImportInProgress(true); - QualType copied_qual_type = m_ast_importer_sp->CopyType (m_ast_context, src_ast->getASTContext(), ClangASTContext::GetQualType(src_type)); + QualType copied_qual_type = + m_ast_importer_sp->CopyType(m_ast_context, src_ast->getASTContext(), ClangUtil::GetQualType(src_type)); SetImportInProgress(false); @@ -1933,14 +1935,8 @@ NameSearchContext::AddVarDecl(const CompilerType &type) clang::ASTContext *ast = lldb_ast->getASTContext(); - clang::NamedDecl *Decl = VarDecl::Create(*ast, - const_cast<DeclContext*>(m_decl_context), - SourceLocation(), - SourceLocation(), - ii, - ClangASTContext::GetQualType(type), - 0, - SC_Static); + clang::NamedDecl *Decl = VarDecl::Create(*ast, const_cast<DeclContext *>(m_decl_context), SourceLocation(), + SourceLocation(), ii, ClangUtil::GetQualType(type), 0, SC_Static); m_decls.push_back(Decl); return Decl; @@ -1963,7 +1959,7 @@ NameSearchContext::AddFunDecl (const CompilerType &type, bool extern_c) m_function_types.insert(type); - QualType qual_type (ClangASTContext::GetQualType(type)); + QualType qual_type(ClangUtil::GetQualType(type)); clang::ASTContext *ast = lldb_ast->getASTContext(); @@ -2059,7 +2055,7 @@ NameSearchContext::AddTypeDecl(const CompilerType &clang_type) { if (clang_type) { - QualType qual_type = ClangASTContext::GetQualType(clang_type); + QualType qual_type = ClangUtil::GetQualType(clang_type); if (const TypedefType *typedef_type = llvm::dyn_cast<TypedefType>(qual_type)) { |