diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-12-25 23:43:52 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-12-26 10:36:36 +0100 |
| commit | b036f557cee5b8eb87f0bffa7c305df6eda98437 (patch) | |
| tree | 0c6bd51eeb1ada6be3900eb42e0b08669b904fa9 /lldb/source/Symbol | |
| parent | 073cdb239044dc056a3c79b995265f640ffb40e6 (diff) | |
| download | bcm5719-llvm-b036f557cee5b8eb87f0bffa7c305df6eda98437.tar.gz bcm5719-llvm-b036f557cee5b8eb87f0bffa7c305df6eda98437.zip | |
[lldb] Remove some calls to GetASTContext
GetASTContext is really expensive to call as it makes use of the global
mapping from ASTContext to ClangASTContext. This replaces all calls where
we already have the ClangASTContext around and don't need to call
GetASTContext again.
Diffstat (limited to 'lldb/source/Symbol')
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index dab210c15f4..089d0177c8f 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -902,7 +902,7 @@ CompilerType ClangASTContext::GetBasicType(lldb::BasicType basic_type) { GetOpaqueCompilerType(&ast, basic_type); if (clang_type) - return CompilerType(GetASTContext(&ast), clang_type); + return CompilerType(this, clang_type); return CompilerType(); } @@ -2736,9 +2736,7 @@ bool ClangASTContext::IsVectorType(lldb::opaque_compiler_type_t type, bool ClangASTContext::IsRuntimeGeneratedType( lldb::opaque_compiler_type_t type) { - clang::DeclContext *decl_ctx = - ClangASTContext::GetASTContext(&getASTContext()) - ->GetDeclContextForType(GetQualType(type)); + clang::DeclContext *decl_ctx = GetDeclContextForType(GetQualType(type)); if (!decl_ctx) return false; @@ -7757,9 +7755,8 @@ clang::ObjCMethodDecl *ClangASTContext::AddMethodToObjCObjectType( clang::SourceLocation(), // endLoc, method_selector, method_function_prototype->getReturnType(), nullptr, // TypeSourceInfo *ResultTInfo, - ClangASTContext::GetASTContext(&ast)->GetDeclContextForType( - ClangUtil::GetQualType(type)), - isInstance, isVariadic, isPropertyAccessor, isSynthesizedAccessorStub, + lldb_ast->GetDeclContextForType(ClangUtil::GetQualType(type)), isInstance, + isVariadic, isPropertyAccessor, isSynthesizedAccessorStub, isImplicitlyDeclared, isDefined, impControl, HasRelatedResultType); if (objc_method_decl == nullptr) |

