blob: 9c0cc0bf82337b6756a001cbff5c0fb72c56e9e9 [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,
16 const ModuleInfoEx &MI)
17 : NativeRawSymbol(Session), Module(MI) {}
18
19PDB_SymType NativeCompilandSymbol::getSymTag() const {
20 return PDB_SymType::Compiland;
21}
22
23bool NativeCompilandSymbol::isEditAndContinueEnabled() const {
24 return Module.Info.hasECInfo();
25}
26
27uint32_t NativeCompilandSymbol::getLexicalParentId() const { return 0; }
28
Adrian McCarthyad6d60a2017-03-15 20:29:06 +000029// The usage of getObjFileName for getLibraryName and getModuleName for getName
30// may seem backwards, but it is consistent with DIA, which is what this API
31// was modeled after. We may rename these methods later to try to eliminate
32// this potential confusion.
Adrian McCarthy65d26882017-03-15 20:17:58 +000033
34std::string NativeCompilandSymbol::getLibraryName() const {
35 return Module.Info.getObjFileName();
36}
37
38std::string NativeCompilandSymbol::getName() const {
39 return Module.Info.getModuleName();
40}
41
42} // namespace pdb
43} // namespace llvm