diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-12-23 09:05:07 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-12-23 09:56:54 +0100 |
| commit | 42ec584a8b4e604360b7a4d45a65c570d58b1bf9 (patch) | |
| tree | 4aad4736fe921fd2e1fdbd916671d736709a4fdc /lldb/source/Plugins/SymbolFile/NativePDB | |
| parent | 6d5e35e89d73711b494c83d3f8b68582d06a0b53 (diff) | |
| download | bcm5719-llvm-42ec584a8b4e604360b7a4d45a65c570d58b1bf9.tar.gz bcm5719-llvm-42ec584a8b4e604360b7a4d45a65c570d58b1bf9.zip | |
[lldb][NFC] Make CompilerDeclContext construction type safe
The CompilerDeclContext constructor takes a void* pointer which
means that all callers of this constructor need to first explicitly
convert all pointers to clang::DeclContext*. This causes that we
for example can't just pass a TranslationUnitDecl* to the constructor without
first casting it to its parent class (as it inherits from both
Decl and DeclContext so the void* pointer is actually a Decl*).
This patch introduces a utility function in the ClangASTContext
which gets rid of the requirement to cast all pointers to
clang::DeclContext. Also moves all constructor calls to use this
function instead which is NFC (beside the change in
DWARFASTParserClangTests.cpp).
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/NativePDB')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp index 2b70f4602b8..7a1a64816f4 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp @@ -1343,7 +1343,7 @@ CompilerType PdbAstBuilder::ToCompilerType(clang::QualType qt) { CompilerDeclContext PdbAstBuilder::ToCompilerDeclContext(clang::DeclContext &context) { - return {&m_clang, &context}; + return m_clang.CreateDeclContext(&context); } clang::Decl * PdbAstBuilder::FromCompilerDecl(CompilerDecl decl) { |

