1 //===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"
11 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
13 #include "llvm/ADT/STLExtras.h"
18 NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,
20 DbiModuleDescriptor MI)
21 : NativeRawSymbol(Session, PDB_SymType::Compiland, SymbolId), Module(MI) {}
23 PDB_SymType NativeCompilandSymbol::getSymTag() const {
24 return PDB_SymType::Compiland;
27 void NativeCompilandSymbol::dump(raw_ostream &OS, int Indent,
28 PdbSymbolIdField ShowIdFields,
29 PdbSymbolIdField RecurseIdFields) const {
30 NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);
32 dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,
33 PdbSymbolIdField::LexicalParent, ShowIdFields,
35 dumpSymbolField(OS, "libraryName", getLibraryName(), Indent);
36 dumpSymbolField(OS, "name", getName(), Indent);
37 dumpSymbolField(OS, "editAndContinueEnabled", isEditAndContinueEnabled(),
41 bool NativeCompilandSymbol::isEditAndContinueEnabled() const {
42 return Module.hasECInfo();
45 SymIndexId NativeCompilandSymbol::getLexicalParentId() const { return 0; }
47 // The usage of getObjFileName for getLibraryName and getModuleName for getName
48 // may seem backwards, but it is consistent with DIA, which is what this API
49 // was modeled after. We may rename these methods later to try to eliminate
50 // this potential confusion.
52 std::string NativeCompilandSymbol::getLibraryName() const {
53 return Module.getObjFileName();
56 std::string NativeCompilandSymbol::getName() const {
57 return Module.getModuleName();