forked from OSchip/llvm-project
[DebugInfoPDB] A few cleanups on PDB Variant class.
Also implements the PDBSymbolCompilandEnv::getValue() method, which until now had been unimplemented specifically because variant did not support string values. llvm-svn: 261173
This commit is contained in:
parent
22d2878399
commit
2a9ac0d2c5
|
@ -363,7 +363,7 @@ struct Variant {
|
|||
}
|
||||
|
||||
~Variant() {
|
||||
if (Type == PDB_VariantType::String && Value.String != nullptr)
|
||||
if (Type == PDB_VariantType::String)
|
||||
delete[] Value.String;
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ struct Variant {
|
|||
Variant &operator=(const Variant &Other) {
|
||||
if (this == &Other)
|
||||
return *this;
|
||||
if (Type == PDB_VariantType::String && Value.String != nullptr)
|
||||
if (Type == PDB_VariantType::String)
|
||||
delete[] Value.String;
|
||||
Type = Other.Type;
|
||||
Value = Other.Value;
|
||||
|
|
|
@ -22,8 +22,10 @@ PDBSymbolCompilandEnv::PDBSymbolCompilandEnv(
|
|||
: PDBSymbol(PDBSession, std::move(Symbol)) {}
|
||||
|
||||
std::string PDBSymbolCompilandEnv::getValue() const {
|
||||
// call RawSymbol->getValue() and convert the result to an std::string.
|
||||
return std::string();
|
||||
llvm::Variant Value = RawSymbol->getValue();
|
||||
if (Value.Type != PDB_VariantType::String)
|
||||
return std::string();
|
||||
return std::string(Value.Value.String);
|
||||
}
|
||||
|
||||
void PDBSymbolCompilandEnv::dump(PDBSymDumper &Dumper) const {
|
||||
|
|
Loading…
Reference in New Issue