brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · d243643 Raw
59 lines · cpp
1//===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"10#include "llvm/DebugInfo/PDB/Native/NativeSession.h"11 12namespace llvm {13namespace pdb {14 15NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,16                                             SymIndexId SymbolId,17                                             DbiModuleDescriptor MI)18    : NativeRawSymbol(Session, PDB_SymType::Compiland, SymbolId), Module(MI) {}19 20PDB_SymType NativeCompilandSymbol::getSymTag() const {21  return PDB_SymType::Compiland;22}23 24void NativeCompilandSymbol::dump(raw_ostream &OS, int Indent,25                                 PdbSymbolIdField ShowIdFields,26                                 PdbSymbolIdField RecurseIdFields) const {27  NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);28 29  dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,30                    PdbSymbolIdField::LexicalParent, ShowIdFields,31                    RecurseIdFields);32  dumpSymbolField(OS, "libraryName", getLibraryName(), Indent);33  dumpSymbolField(OS, "name", getName(), Indent);34  dumpSymbolField(OS, "editAndContinueEnabled", isEditAndContinueEnabled(),35                  Indent);36}37 38bool NativeCompilandSymbol::isEditAndContinueEnabled() const {39  return Module.hasECInfo();40}41 42SymIndexId NativeCompilandSymbol::getLexicalParentId() const { return 0; }43 44// The usage of getObjFileName for getLibraryName and getModuleName for getName45// may seem backwards, but it is consistent with DIA, which is what this API46// was modeled after.  We may rename these methods later to try to eliminate47// this potential confusion.48 49std::string NativeCompilandSymbol::getLibraryName() const {50  return std::string(Module.getObjFileName());51}52 53std::string NativeCompilandSymbol::getName() const {54  return std::string(Module.getModuleName());55}56 57} // namespace pdb58} // namespace llvm59