Path: blob/main/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp
35293 views
//===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"9#include "llvm/DebugInfo/PDB/Native/NativeSession.h"1011namespace llvm {12namespace pdb {1314NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,15SymIndexId SymbolId,16DbiModuleDescriptor MI)17: NativeRawSymbol(Session, PDB_SymType::Compiland, SymbolId), Module(MI) {}1819PDB_SymType NativeCompilandSymbol::getSymTag() const {20return PDB_SymType::Compiland;21}2223void NativeCompilandSymbol::dump(raw_ostream &OS, int Indent,24PdbSymbolIdField ShowIdFields,25PdbSymbolIdField RecurseIdFields) const {26NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);2728dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,29PdbSymbolIdField::LexicalParent, ShowIdFields,30RecurseIdFields);31dumpSymbolField(OS, "libraryName", getLibraryName(), Indent);32dumpSymbolField(OS, "name", getName(), Indent);33dumpSymbolField(OS, "editAndContinueEnabled", isEditAndContinueEnabled(),34Indent);35}3637bool NativeCompilandSymbol::isEditAndContinueEnabled() const {38return Module.hasECInfo();39}4041SymIndexId NativeCompilandSymbol::getLexicalParentId() const { return 0; }4243// The usage of getObjFileName for getLibraryName and getModuleName for getName44// may seem backwards, but it is consistent with DIA, which is what this API45// was modeled after. We may rename these methods later to try to eliminate46// this potential confusion.4748std::string NativeCompilandSymbol::getLibraryName() const {49return std::string(Module.getObjFileName());50}5152std::string NativeCompilandSymbol::getName() const {53return std::string(Module.getModuleName());54}5556} // namespace pdb57} // namespace llvm585960