1 //===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===//
2 //
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 
12 namespace llvm {
13 namespace pdb {
14 
15 NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,
16                                              uint32_t SymbolId,
17                                              DbiModuleDescriptor MI)
18     : NativeRawSymbol(Session, SymbolId), Module(MI) {}
19 
20 PDB_SymType NativeCompilandSymbol::getSymTag() const {
21   return PDB_SymType::Compiland;
22 }
23 
24 std::unique_ptr<NativeRawSymbol> NativeCompilandSymbol::clone() const {
25   return std::make_unique<NativeCompilandSymbol>(Session, SymbolId, Module);
26 }
27 
28 bool NativeCompilandSymbol::isEditAndContinueEnabled() const {
29   return Module.hasECInfo();
30 }
31 
32 uint32_t NativeCompilandSymbol::getLexicalParentId() const { return 0; }
33 
34 // 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.
38 
39 std::string NativeCompilandSymbol::getLibraryName() const {
40   return Module.getObjFileName();
41 }
42 
43 std::string NativeCompilandSymbol::getName() const {
44   return Module.getModuleName();
45 }
46 
47 } // namespace pdb
48 } // namespace llvm
49