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/Plugins/SymbolFile | |
| 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/Plugins/SymbolFile')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp index f647abf7b5f..6b2dbd9e1e5 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp @@ -118,31 +118,24 @@ GetBuiltinTypeForPDBEncodingAndBitSize(ClangASTContext &clang_ast, return clang_ast.GetBasicType(eBasicTypeBool); case PDB_BuiltinType::Long: if (width == ast.getTypeSize(ast.LongTy)) - return CompilerType(ClangASTContext::GetASTContext(&ast), - ast.LongTy.getAsOpaquePtr()); + return CompilerType(&clang_ast, ast.LongTy.getAsOpaquePtr()); if (width == ast.getTypeSize(ast.LongLongTy)) - return CompilerType(ClangASTContext::GetASTContext(&ast), - ast.LongLongTy.getAsOpaquePtr()); + return CompilerType(&clang_ast, ast.LongLongTy.getAsOpaquePtr()); break; case PDB_BuiltinType::ULong: if (width == ast.getTypeSize(ast.UnsignedLongTy)) - return CompilerType(ClangASTContext::GetASTContext(&ast), - ast.UnsignedLongTy.getAsOpaquePtr()); + return CompilerType(&clang_ast, ast.UnsignedLongTy.getAsOpaquePtr()); if (width == ast.getTypeSize(ast.UnsignedLongLongTy)) - return CompilerType(ClangASTContext::GetASTContext(&ast), - ast.UnsignedLongLongTy.getAsOpaquePtr()); + return CompilerType(&clang_ast, ast.UnsignedLongLongTy.getAsOpaquePtr()); break; case PDB_BuiltinType::WCharT: if (width == ast.getTypeSize(ast.WCharTy)) - return CompilerType(ClangASTContext::GetASTContext(&ast), - ast.WCharTy.getAsOpaquePtr()); + return CompilerType(&clang_ast, ast.WCharTy.getAsOpaquePtr()); break; case PDB_BuiltinType::Char16: - return CompilerType(ClangASTContext::GetASTContext(&ast), - ast.Char16Ty.getAsOpaquePtr()); + return CompilerType(&clang_ast, ast.Char16Ty.getAsOpaquePtr()); case PDB_BuiltinType::Char32: - return CompilerType(ClangASTContext::GetASTContext(&ast), - ast.Char32Ty.getAsOpaquePtr()); + return CompilerType(&clang_ast, ast.Char32Ty.getAsOpaquePtr()); case PDB_BuiltinType::Float: // Note: types `long double` and `double` have same bit size in MSVC and // there is no information in the PDB to distinguish them. So when falling |

