mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
bcf0078c33
The way DIA SDK works is that when you request a symbol, it gets assigned an internal identifier that is unique for the life of the session. You can then use this identifier to get back the same symbol, with all of the same internal state that it had before, even if you "destroyed" the original copy of the object you had. This didn't work properly in our native implementation, and if you destroyed an object for a particular symbol, then requested the same symbol again, it would get assigned a new ID and you'd get a fresh copy of the object. In order to fix this some refactoring had to happen to properly reuse cached objects. Some unittests are added to verify that symbol reuse is taking place, making use of the new unittest input feature. llvm-svn: 341503
31 lines
899 B
C++
31 lines
899 B
C++
//===- PDBSymbolCompilandEnv.cpp - compiland env variables ------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
|
|
|
|
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
|
|
#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
|
|
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
|
|
|
|
#include <utility>
|
|
|
|
using namespace llvm;
|
|
using namespace llvm::pdb;
|
|
|
|
std::string PDBSymbolCompilandEnv::getValue() const {
|
|
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 {
|
|
Dumper.dump(*this);
|
|
}
|