[Lldb-commits] [PATCH] D55571: [ast] CreateParameterDeclaration should use an appropriate DeclContext.
Zachary Turner via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 12 09:22:34 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB348941: [ast] CreateParameterDeclaration should use an appropriate DeclContext. (authored by zturner, committed by ).
Herald added a subscriber: teemperor.
Changed prior to commit:
https://reviews.llvm.org/D55571?vs=177761&id=177864#toc
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55571/new/
https://reviews.llvm.org/D55571
Files:
include/lldb/Symbol/ClangASTContext.h
source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
source/Symbol/ClangASTContext.cpp
Index: source/Symbol/ClangASTContext.cpp
===================================================================
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -2214,11 +2214,11 @@
}
ParmVarDecl *ClangASTContext::CreateParameterDeclaration(
- const char *name, const CompilerType ¶m_type, int storage) {
+ clang::DeclContext *decl_ctx, const char *name,
+ const CompilerType ¶m_type, int storage) {
ASTContext *ast = getASTContext();
assert(ast != nullptr);
- return ParmVarDecl::Create(*ast, ast->getTranslationUnitDecl(),
- SourceLocation(), SourceLocation(),
+ return ParmVarDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(),
name && name[0] ? &ast->Idents.get(name) : nullptr,
ClangUtil::GetQualType(param_type), nullptr,
(clang::StorageClass)storage, nullptr);
Index: source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
===================================================================
--- source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -635,8 +635,8 @@
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;
Index: source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
===================================================================
--- source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -932,7 +932,8 @@
continue;
clang::ParmVarDecl *param = m_ast.CreateParameterDeclaration(
- nullptr, arg_type->GetForwardCompilerType(), clang::SC_None);
+ decl, nullptr, arg_type->GetForwardCompilerType(),
+ clang::SC_None);
if (param)
params.push_back(param);
}
Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3407,8 +3407,9 @@
function_param_types.push_back(type->GetForwardCompilerType());
clang::ParmVarDecl *param_var_decl =
- m_ast.CreateParameterDeclaration(
- name, type->GetForwardCompilerType(), storage);
+ m_ast.CreateParameterDeclaration(containing_decl_ctx, name,
+ type->GetForwardCompilerType(),
+ storage);
assert(param_var_decl);
function_param_decls.push_back(param_var_decl);
Index: include/lldb/Symbol/ClangASTContext.h
===================================================================
--- include/lldb/Symbol/ClangASTContext.h
+++ include/lldb/Symbol/ClangASTContext.h
@@ -401,7 +401,8 @@
type_quals, cc);
}
- clang::ParmVarDecl *CreateParameterDeclaration(const char *name,
+ clang::ParmVarDecl *CreateParameterDeclaration(clang::DeclContext *decl_ctx,
+ const char *name,
const CompilerType ¶m_type,
int storage);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55571.177864.patch
Type: text/x-patch
Size: 3832 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181212/88b51c68/attachment.bin>
More information about the lldb-commits
mailing list