LLVM  15.0.0git
NativeCompilandSymbol.cpp
Go to the documentation of this file.
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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
11 
12 namespace llvm {
13 namespace pdb {
14 
16  SymIndexId SymbolId,
18  : NativeRawSymbol(Session, PDB_SymType::Compiland, SymbolId), Module(MI) {}
19 
22 }
23 
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 
39  return Module.hasECInfo();
40 }
41 
43 
44 // The usage of getObjFileName for getLibraryName and getModuleName for getName
45 // may seem backwards, but it is consistent with DIA, which is what this API
46 // was modeled after. We may rename these methods later to try to eliminate
47 // this potential confusion.
48 
50  return std::string(Module.getObjFileName());
51 }
52 
53 std::string NativeCompilandSymbol::getName() const {
54  return std::string(Module.getModuleName());
55 }
56 
57 } // namespace pdb
58 } // namespace llvm
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
NativeCompilandSymbol.h
llvm::pdb::NativeCompilandSymbol::isEditAndContinueEnabled
bool isEditAndContinueEnabled() const override
Definition: NativeCompilandSymbol.cpp:38
llvm::pdb::PDB_SymType
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....
Definition: PDBTypes.h:243
llvm::pdb::NativeCompilandSymbol::getLexicalParentId
SymIndexId getLexicalParentId() const override
Definition: NativeCompilandSymbol.cpp:42
llvm::pdb::PdbSymbolIdField::LexicalParent
@ LexicalParent
llvm::pdb::NativeCompilandSymbol::NativeCompilandSymbol
NativeCompilandSymbol(NativeSession &Session, SymIndexId SymbolId, DbiModuleDescriptor MI)
Definition: NativeCompilandSymbol.cpp:15
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::pdb::dumpSymbolField
void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent)
Definition: PDBExtras.h:47
llvm::pdb::dumpSymbolIdField
void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value, int Indent, const IPDBSession &Session, PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags)
Definition: PDBSymbol.cpp:202
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
uint32_t
llvm::pdb::NativeCompilandSymbol::getSymTag
PDB_SymType getSymTag() const override
Definition: NativeCompilandSymbol.cpp:20
llvm::pdb::PDB_SymType::Compiland
@ Compiland
llvm::pdb::NativeRawSymbol::dump
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
Definition: NativeRawSymbol.cpp:21
llvm::pdb::NativeSession
Definition: NativeSession.h:32
llvm::pdb::PdbSymbolIdField
PdbSymbolIdField
Definition: IPDBRawSymbol.h:24
llvm::pdb::NativeCompilandSymbol::getName
std::string getName() const override
Definition: NativeCompilandSymbol.cpp:53
llvm::pdb::NativeCompilandSymbol::dump
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
Definition: NativeCompilandSymbol.cpp:24
llvm::pdb::NativeRawSymbol::Session
NativeSession & Session
Definition: NativeRawSymbol.h:232
llvm::pdb::NativeCompilandSymbol::getLibraryName
std::string getLibraryName() const override
Definition: NativeCompilandSymbol.cpp:49
llvm::pdb::DbiModuleDescriptor
Definition: DbiModuleDescriptor.h:23
llvm::pdb::NativeRawSymbol
Definition: NativeRawSymbol.h:21
NativeSession.h