Skip to content

Commit e31457a

Browse files
Merge pull request #1956 from adrian-prantl/constant_loc-main
Cherry-pick & resolve merge conflict
2 parents c1548e8 + 9886422 commit e31457a

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

lldb/include/lldb/Symbol/Variable.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class Variable : public UserID, public std::enable_shared_from_this<Variable> {
3333
const lldb::SymbolFileTypeSP &symfile_type_sp, lldb::ValueType scope,
3434
SymbolContextScope *owner_scope, const RangeList &scope_range,
3535
Declaration *decl, const DWARFExpression &location, bool external,
36-
bool artificial, bool static_member, bool constant);
36+
bool artificial, bool location_is_constant_data, bool static_member,
37+
bool constant);
3738

3839
virtual ~Variable();
3940

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3511,9 +3511,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
35113511
var_sp = std::make_shared<Variable>(
35123512
die.GetID(), name, mangled, type_sp, scope, symbol_context_scope,
35133513
scope_ranges, &decl, location, is_external, is_artificial,
3514-
is_static_member, is_constant);
3515-
3516-
var_sp->SetLocationIsConstantValueData(location_is_const_value_data);
3514+
location_is_const_value_data, is_static_member, is_constant);
35173515
} else {
35183516
// Not ready to parse this variable yet. It might be a global or static
35193517
// variable that is in a function scope and the function in the symbol

lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -812,8 +812,7 @@ VariableSP SymbolFileNativePDB::CreateGlobalVariable(PdbGlobalSymId var_id) {
812812
VariableSP var_sp = std::make_shared<Variable>(
813813
toOpaqueUid(var_id), name.str().c_str(), global_name.c_str(), type_sp,
814814
scope, comp_unit.get(), ranges, &decl, location, is_external, false,
815-
false, false);
816-
var_sp->SetLocationIsConstantValueData(false);
815+
false, false, false);
817816

818817
return var_sp;
819818
}
@@ -840,8 +839,7 @@ SymbolFileNativePDB::CreateConstantSymbol(PdbGlobalSymId var_id,
840839
VariableSP var_sp = std::make_shared<Variable>(
841840
toOpaqueUid(var_id), constant.Name.str().c_str(), global_name.c_str(),
842841
type_sp, eValueTypeVariableGlobal, module.get(), ranges, &decl, location,
843-
false, false, false, true);
844-
var_sp->SetLocationIsConstantValueData(true);
842+
false, false, true, false, true);
845843
return var_sp;
846844
}
847845

@@ -1346,7 +1344,7 @@ VariableSP SymbolFileNativePDB::CreateLocalVariable(PdbCompilandSymId scope_id,
13461344
VariableSP var_sp = std::make_shared<Variable>(
13471345
toOpaqueUid(var_id), name.c_str(), name.c_str(), sftype, var_scope,
13481346
comp_unit_sp.get(), *var_info.ranges, &decl, *var_info.location, false,
1349-
false, false, false);
1347+
false, false, false, false);
13501348

13511349
if (!is_param)
13521350
m_ast->GetOrCreateVariableDecl(scope_id, var_id);

lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,9 +1020,8 @@ VariableSP SymbolFilePDB::ParseVariableForPDBData(
10201020

10211021
var_sp = std::make_shared<Variable>(
10221022
var_uid, var_name.c_str(), mangled_cstr, type_sp, scope, context_scope,
1023-
ranges, &decl, location, is_external, is_artificial, is_static_member,
1024-
is_constant);
1025-
var_sp->SetLocationIsConstantValueData(is_constant);
1023+
ranges, &decl, location, is_external, is_artificial, is_constant,
1024+
is_static_member, is_constant);
10261025

10271026
m_variables.insert(std::make_pair(var_uid, var_sp));
10281027
return var_sp;

lldb/source/Symbol/Variable.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ Variable::Variable(lldb::user_id_t uid, const char *name, const char *mangled,
4040
ValueType scope, SymbolContextScope *context,
4141
const RangeList &scope_range, Declaration *decl_ptr,
4242
const DWARFExpression &location, bool external,
43-
bool artificial, bool static_member, bool constant)
43+
bool artificial, bool location_is_constant_data,
44+
bool static_member, bool constant)
4445
: UserID(uid), m_name(name), m_mangled(ConstString(mangled)),
4546
m_symfile_type_sp(symfile_type_sp), m_scope(scope),
4647
m_owner_scope(context), m_scope_range(scope_range),
4748
m_declaration(decl_ptr), m_location(location), m_external(external),
48-
m_artificial(artificial), m_loc_is_const_data(false),
49+
m_artificial(artificial), m_loc_is_const_data(location_is_constant_data),
4950
m_static_member(static_member), m_constant(constant) {}
5051

5152
Variable::~Variable() {}

0 commit comments

Comments
 (0)