summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
diff options
context:
space:
mode:
authorShafik Yaghmour <syaghmour@apple.com>2019-08-02 21:41:50 +0000
committerShafik Yaghmour <syaghmour@apple.com>2019-08-02 21:41:50 +0000
commitfa5c340ea12e5f5b217246767190d32ccb7df54a (patch)
tree9795f3b72e048f8799945a5a911d1316da7ccb80 /lldb/source/Plugins/SymbolFile
parentd021617bf7e1a34ac8f8d25146bea1af97580e3b (diff)
downloadbcm5719-llvm-fa5c340ea12e5f5b217246767190d32ccb7df54a.tar.gz
bcm5719-llvm-fa5c340ea12e5f5b217246767190d32ccb7df54a.zip
Fix ClangASTContext::CreateParameterDeclaration to not call addDecl
Summary: The change https://reviews.llvm.org/D55575 modified ClangASTContext::CreateParameterDeclaration to call decl_ctx->addDecl(decl); this caused a regression since the existing code in DWARFASTParserClang::ParseChildParameters is called with the containing DeclContext. So when end up with cases where we are parsing a parameter for a member function and the parameter is added to the CXXRecordDecl as opposed to the CXXMethodDecl. This example is given in the regression test TestBreakpointInMemberFuncWNonPrimitiveParams.py which without this fix in a modules build leads to assert on setting a breakpoint in a member function with non primitive parameters. This scenario would be common when debugging LLDB or clang. Differential Revision: https://reviews.llvm.org/D65414 llvm-svn: 367726
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
index 6ab45de4433..986b0b785d8 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
@@ -1084,7 +1084,7 @@ void PdbAstBuilder::CreateFunctionParameters(PdbCompilandSymId func_id,
CompilerType param_type_ct(&m_clang, qt.getAsOpaquePtr());
clang::ParmVarDecl *param = m_clang.CreateParameterDeclaration(
&function_decl, param_name.str().c_str(), param_type_ct,
- clang::SC_None);
+ clang::SC_None, true);
lldbassert(m_uid_to_decl.count(toOpaqueUid(param_uid)) == 0);
m_uid_to_decl[toOpaqueUid(param_uid)] = param;
diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
index 82cfcfbb040..4ab384e67e2 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -940,7 +940,7 @@ PDBASTParser::GetDeclForSymbol(const llvm::pdb::PDBSymbol &symbol) {
clang::ParmVarDecl *param = m_ast.CreateParameterDeclaration(
decl, nullptr, arg_type->GetForwardCompilerType(),
- clang::SC_None);
+ clang::SC_None, true);
if (param)
params.push_back(param);
}
OpenPOWER on IntegriCloud