LLVM  14.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 #include "llvm/ADT/STLExtras.h"
13 
14 namespace llvm {
15 namespace pdb {
16 
18  SymIndexId SymbolId,
20  : NativeRawSymbol(Session, PDB_SymType::Compiland, SymbolId), Module(MI) {}
21 
24 }
25 
27  PdbSymbolIdField ShowIdFields,
28  PdbSymbolIdField RecurseIdFields) const {
29  NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);
30 
31  dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,
32  PdbSymbolIdField::LexicalParent, ShowIdFields,
33  RecurseIdFields);
34  dumpSymbolField(OS, "libraryName", getLibraryName(), Indent);
35  dumpSymbolField(OS, "name", getName(), Indent);
36  dumpSymbolField(OS, "editAndContinueEnabled", isEditAndContinueEnabled(),
37  Indent);
38 }
39 
41  return Module.hasECInfo();
42 }
43 
45 
46 // The usage of getObjFileName for getLibraryName and getModuleName for getName
47 // may seem backwards, but it is consistent with DIA, which is what this API
48 // was modeled after. We may rename these methods later to try to eliminate
49 // this potential confusion.
50 
52  return std::string(Module.getObjFileName());
53 }
54 
55 std::string NativeCompilandSymbol::getName() const {
56  return std::string(Module.getModuleName());
57 }
58 
59 } // namespace pdb
60 } // namespace llvm
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
NativeCompilandSymbol.h
STLExtras.h
llvm::pdb::NativeCompilandSymbol::isEditAndContinueEnabled
bool isEditAndContinueEnabled() const override
Definition: NativeCompilandSymbol.cpp:40
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:44
llvm::pdb::PdbSymbolIdField::LexicalParent
@ LexicalParent
llvm::pdb::NativeCompilandSymbol::NativeCompilandSymbol
NativeCompilandSymbol(NativeSession &Session, SymIndexId SymbolId, DbiModuleDescriptor MI)
Definition: NativeCompilandSymbol.cpp:17
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
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:67
uint32_t
llvm::pdb::NativeCompilandSymbol::getSymTag
PDB_SymType getSymTag() const override
Definition: NativeCompilandSymbol.cpp:22
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:22
llvm::pdb::NativeSession
Definition: NativeSession.h:28
llvm::pdb::PdbSymbolIdField
PdbSymbolIdField
Definition: IPDBRawSymbol.h:24
llvm::pdb::NativeCompilandSymbol::getName
std::string getName() const override
Definition: NativeCompilandSymbol.cpp:55
llvm::pdb::NativeCompilandSymbol::dump
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
Definition: NativeCompilandSymbol.cpp:26
llvm::pdb::NativeRawSymbol::Session
NativeSession & Session
Definition: NativeRawSymbol.h:232
llvm::pdb::NativeCompilandSymbol::getLibraryName
std::string getLibraryName() const override
Definition: NativeCompilandSymbol.cpp:51
llvm::pdb::DbiModuleDescriptor
Definition: DbiModuleDescriptor.h:23
llvm::pdb::NativeRawSymbol
Definition: NativeRawSymbol.h:21
NativeSession.h