llvm/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp
Zachary Turner cd405abe71 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 22:46:33 +00:00

34 lines
1.0 KiB
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/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
using namespace llvm;
PDBSymbolCompilandEnv::PDBSymbolCompilandEnv(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
: PDBSymbol(PDBSession, std::move(Symbol)) {}
std::string PDBSymbolCompilandEnv::getValue() const {
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 {
Dumper.dump(*this);
}