blob: bd5cdd4691e4150af3924fe3201b79d8b7f5e7bb [file] [log] [blame]
Adrian McCarthyad6d60a2017-03-15 20:29:06 +00001//===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===//
Adrian McCarthy65d26882017-03-15 20:17:58 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"
11
12namespace llvm {
13namespace pdb {
14
15NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,
Adrian McCarthy31bcb6f2017-06-22 18:43:18 +000016 uint32_t SymbolId,
Zachary Turner1eb9a022017-05-04 23:53:29 +000017 DbiModuleDescriptor MI)
Adrian McCarthy31bcb6f2017-06-22 18:43:18 +000018 : NativeRawSymbol(Session, SymbolId), Module(MI) {}
Adrian McCarthy65d26882017-03-15 20:17:58 +000019
20PDB_SymType NativeCompilandSymbol::getSymTag() const {
21 return PDB_SymType::Compiland;
22}
23
Adrian McCarthy31bcb6f2017-06-22 18:43:18 +000024std::unique_ptr<NativeRawSymbol> NativeCompilandSymbol::clone() const {
25 return std::make_unique<NativeCompilandSymbol>(Session, SymbolId, Module);
26}
27
Adrian McCarthy65d26882017-03-15 20:17:58 +000028bool NativeCompilandSymbol::isEditAndContinueEnabled() const {
Zachary Turner1eb9a022017-05-04 23:53:29 +000029 return Module.hasECInfo();
Adrian McCarthy65d26882017-03-15 20:17:58 +000030}
31
32uint32_t NativeCompilandSymbol::getLexicalParentId() const { return 0; }
33
Adrian McCarthyad6d60a2017-03-15 20:29:06 +000034// The usage of getObjFileName for getLibraryName and getModuleName for getName
35// may seem backwards, but it is consistent with DIA, which is what this API
36// was modeled after. We may rename these methods later to try to eliminate
37// this potential confusion.
Adrian McCarthy65d26882017-03-15 20:17:58 +000038
39std::string NativeCompilandSymbol::getLibraryName() const {
Zachary Turner1eb9a022017-05-04 23:53:29 +000040 return Module.getObjFileName();
Adrian McCarthy65d26882017-03-15 20:17:58 +000041}
42
43std::string NativeCompilandSymbol::getName() const {
Zachary Turner1eb9a022017-05-04 23:53:29 +000044 return Module.getModuleName();
Adrian McCarthy65d26882017-03-15 20:17:58 +000045}
46
47} // namespace pdb
48} // namespace llvm