summaryrefslogtreecommitdiff
path: root/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-12-12 17:17:53 +0000
committerZachary Turner <zturner@google.com>2018-12-12 17:17:53 +0000
commit0746ea990f531c19d2e640c64fcbb7cfcc44c4a1 (patch)
tree3da855393bcf4affef562bfef96281e70af5b84d /source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
parent5b303fa554c64ea2b382fe7242998cbabf00a1f1 (diff)
[ast] CreateParameterDeclaration should use an appropriate DeclContext.
Previously CreateParameterDeclaration was always using the translation unit DeclContext. We would later go and add parameters to the FunctionDecl, but internally clang makes a copy when you do this, and we'd end up with ParmVarDecl's at the global scope as well as in the function scope. This fixes the issue. It's hard to say whether this will introduce a behavioral change in name lookup, but I know there have been several hacks introduced in previous years to deal with collisions between various types of variables, so there's a chance that this patch could obviate one of those hacks. Differential Revision: https://reviews.llvm.org/D55571 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@348941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp')
-rw-r--r--source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index e521c928e..898b43073 100644
--- a/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -635,8 +635,8 @@ lldb::FunctionSP SymbolFileNativePDB::CreateFunction(PdbCompilandSymId func_id,
PdbCompilandSymId param_uid(func_id.modi, record_offset);
TypeSP type_sp = GetOrCreateType(param_type);
clang::ParmVarDecl *param = m_clang->CreateParameterDeclaration(
- param_name.str().c_str(), type_sp->GetForwardCompilerType(),
- clang::SC_None);
+ function_decl, param_name.str().c_str(),
+ type_sp->GetForwardCompilerType(), clang::SC_None);
lldbassert(m_uid_to_decl.count(toOpaqueUid(param_uid)) == 0);
m_uid_to_decl[toOpaqueUid(param_uid)] = param;