Skip to content

Commit

Permalink
Don't use uniform initialization syntax.
Browse files Browse the repository at this point in the history
llvm-svn: 347020
  • Loading branch information
Zachary Turner committed Nov 16, 2018
1 parent 64d85a2 commit 9fbf935
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
Expand Up @@ -134,7 +134,7 @@ void PdbIndex::BuildAddrToSymbolMap(CompilandIndexItem &cci) {
// We need to add 4 here to adjust for the codeview debug magic
// at the beginning of the debug info stream.
uint32_t sym_offset = iter.offset() + 4;
PdbCompilandSymId cu_sym_id{modi, sym_offset};
PdbCompilandSymId cu_sym_id(modi, sym_offset);

// If the debug info is incorrect, we could have multiple symbols with the
// same address. So use try_emplace instead of insert, and the first one
Expand Down
11 changes: 11 additions & 0 deletions lldb/source/Plugins/SymbolFile/NativePDB/PdbSymUid.h
Expand Up @@ -43,6 +43,9 @@ struct PdbCompilandId {
};

struct PdbCompilandSymId {
PdbCompilandSymId() = default;
PdbCompilandSymId(uint16_t modi, uint32_t offset)
: modi(modi), offset(offset) {}
// 0-based index of module in PDB
uint16_t modi = 0;

Expand All @@ -53,6 +56,10 @@ struct PdbCompilandSymId {
};

struct PdbGlobalSymId {
PdbGlobalSymId() = default;
PdbGlobalSymId(uint32_t offset, bool is_public)
: offset(offset), is_public(is_public) {}

// Offset of symbol's record in globals or publics stream.
uint32_t offset = 0;

Expand All @@ -62,6 +69,10 @@ struct PdbGlobalSymId {
};

struct PdbTypeSymId {
PdbTypeSymId() = default;
PdbTypeSymId(llvm::codeview::TypeIndex index, bool is_ipi = false)
: index(index), is_ipi(is_ipi) {}

// The index of the of the type in the TPI or IPI stream.
llvm::codeview::TypeIndex index;

Expand Down
19 changes: 9 additions & 10 deletions lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
Expand Up @@ -729,7 +729,7 @@ lldb::FunctionSP SymbolFileNativePDB::CreateFunction(PdbCompilandSymId func_id,
Type *func_type = nullptr;

// FIXME: Resolve types and mangled names.
PdbTypeSymId sig_id{TypeIndex::None(), false};
PdbTypeSymId sig_id(TypeIndex::None(), false);
Mangled mangled(getSymbolName(sym_record));
FunctionSP func_sp = std::make_shared<Function>(
sc.comp_unit, toOpaqueUid(func_id), toOpaqueUid(sig_id), mangled,
Expand Down Expand Up @@ -830,7 +830,7 @@ lldb::TypeSP SymbolFileNativePDB::CreatePointerType(
}

lldb::TypeSP SymbolFileNativePDB::CreateSimpleType(TypeIndex ti) {
uint64_t uid = toOpaqueUid(PdbTypeSymId{ti, false});
uint64_t uid = toOpaqueUid(PdbTypeSymId(ti, false));
if (ti == TypeIndex::NullptrT()) {
CompilerType ct = m_clang->GetBasicType(eBasicTypeNullPtr);
Declaration decl;
Expand Down Expand Up @@ -1163,7 +1163,7 @@ TypeSP SymbolFileNativePDB::CreateAndCacheType(PdbTypeSymId type_id) {
if (!expected_full_ti)
llvm::consumeError(expected_full_ti.takeError());
else if (*expected_full_ti != type_id.index) {
full_decl_uid = PdbTypeSymId{*expected_full_ti, false};
full_decl_uid = PdbTypeSymId(*expected_full_ti, false);

// It's possible that a lookup would occur for the full decl causing it
// to be cached, then a second lookup would occur for the forward decl.
Expand Down Expand Up @@ -1197,7 +1197,6 @@ TypeSP SymbolFileNativePDB::CreateAndCacheType(PdbTypeSymId type_id) {
m_clang->GetAsTagDecl(result->GetForwardCompilerType());
lldbassert(record_decl);

TypeIndex ti(type_id.index);
m_uid_to_decl[best_uid] = record_decl;
m_decl_to_status[record_decl] =
DeclStatus(best_uid, Type::eResolveStateForward);
Expand Down Expand Up @@ -1343,7 +1342,7 @@ VariableSP SymbolFileNativePDB::CreateGlobalVariable(PdbGlobalSymId var_id) {
}

Declaration decl;
PdbTypeSymId tid{ti, false};
PdbTypeSymId tid(ti, false);
SymbolFileTypeSP type_sp =
std::make_shared<SymbolFileType>(*this, toOpaqueUid(tid));
Variable::RangeList ranges;
Expand Down Expand Up @@ -1371,7 +1370,7 @@ SymbolFileNativePDB::CreateConstantSymbol(PdbGlobalSymId var_id,
llvm::cantFail(SymbolDeserializer::deserializeAs<ConstantSym>(cvs, constant));
std::string global_name("::");
global_name += constant.Name;
PdbTypeSymId tid{constant.Type, false};
PdbTypeSymId tid(constant.Type, false);
SymbolFileTypeSP type_sp =
std::make_shared<SymbolFileType>(*this, toOpaqueUid(tid));

Expand Down Expand Up @@ -1399,7 +1398,7 @@ SymbolFileNativePDB::GetOrCreateGlobalVariable(PdbGlobalSymId var_id) {
}

lldb::TypeSP SymbolFileNativePDB::GetOrCreateType(TypeIndex ti) {
return GetOrCreateType(PdbTypeSymId{ti, false});
return GetOrCreateType(PdbTypeSymId(ti, false));
}

FunctionSP SymbolFileNativePDB::GetOrCreateFunction(PdbCompilandSymId func_id,
Expand Down Expand Up @@ -1680,7 +1679,7 @@ uint32_t SymbolFileNativePDB::FindGlobalVariables(
case SymbolKind::S_GTHREAD32:
case SymbolKind::S_LTHREAD32:
case SymbolKind::S_CONSTANT: {
PdbGlobalSymId global{result.first, false};
PdbGlobalSymId global(result.first, false);
var = GetOrCreateGlobalVariable(global);
variables.AddVariable(var);
break;
Expand Down Expand Up @@ -1719,7 +1718,7 @@ uint32_t SymbolFileNativePDB::FindFunctions(

sc.comp_unit = GetOrCreateCompileUnit(cci).get();
sc.module_sp = sc.comp_unit->GetModule();
PdbCompilandSymId func_id{proc.modi(), proc.SymOffset};
PdbCompilandSymId func_id(proc.modi(), proc.SymOffset);
sc.function = GetOrCreateFunction(func_id, sc).get();

sc_list.Append(sc);
Expand Down Expand Up @@ -1856,7 +1855,7 @@ bool SymbolFileNativePDB::CompleteType(CompilerType &compiler_type) {
lldbassert(!IsForwardRefUdt(cvt));
unmodified_type = *expected_full_ti;
}
type_id = PdbTypeSymId{unmodified_type, false};
type_id = PdbTypeSymId(unmodified_type, false);
}
TypeIndex field_list_ti = GetFieldListIndex(cvt);
CVType field_list_cvt = m_index->tpi().getType(field_list_ti);
Expand Down

0 comments on commit 9fbf935

Please sign in to comment.