comparison lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp @ 148:63bd29f05246

merged
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 19:46:37 +0900
parents c2174574ed3a
children
comparison
equal deleted inserted replaced
146:3fc4d5c3e21e 148:63bd29f05246
1 //===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===// 1 //===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // 4 // See https://llvm.org/LICENSE.txt for license information.
5 // This file is distributed under the University of Illinois Open Source 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 // License. See LICENSE.TXT for details.
7 // 6 //
8 //===----------------------------------------------------------------------===// 7 //===----------------------------------------------------------------------===//
9 8
10 #include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h" 9 #include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"
10 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
11 11
12 #include "llvm/ADT/STLExtras.h" 12 #include "llvm/ADT/STLExtras.h"
13 13
14 namespace llvm { 14 namespace llvm {
15 namespace pdb { 15 namespace pdb {
16 16
17 NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session, 17 NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,
18 SymIndexId SymbolId, 18 SymIndexId SymbolId,
19 DbiModuleDescriptor MI) 19 DbiModuleDescriptor MI)
20 : NativeRawSymbol(Session, SymbolId), Module(MI) {} 20 : NativeRawSymbol(Session, PDB_SymType::Compiland, SymbolId), Module(MI) {}
21 21
22 PDB_SymType NativeCompilandSymbol::getSymTag() const { 22 PDB_SymType NativeCompilandSymbol::getSymTag() const {
23 return PDB_SymType::Compiland; 23 return PDB_SymType::Compiland;
24 } 24 }
25 25
26 std::unique_ptr<NativeRawSymbol> NativeCompilandSymbol::clone() const { 26 void NativeCompilandSymbol::dump(raw_ostream &OS, int Indent,
27 return llvm::make_unique<NativeCompilandSymbol>(Session, SymbolId, Module); 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);
28 } 38 }
29 39
30 bool NativeCompilandSymbol::isEditAndContinueEnabled() const { 40 bool NativeCompilandSymbol::isEditAndContinueEnabled() const {
31 return Module.hasECInfo(); 41 return Module.hasECInfo();
32 } 42 }
33 43
34 uint32_t NativeCompilandSymbol::getLexicalParentId() const { return 0; } 44 SymIndexId NativeCompilandSymbol::getLexicalParentId() const { return 0; }
35 45
36 // The usage of getObjFileName for getLibraryName and getModuleName for getName 46 // The usage of getObjFileName for getLibraryName and getModuleName for getName
37 // may seem backwards, but it is consistent with DIA, which is what this API 47 // may seem backwards, but it is consistent with DIA, which is what this API
38 // was modeled after. We may rename these methods later to try to eliminate 48 // was modeled after. We may rename these methods later to try to eliminate
39 // this potential confusion. 49 // this potential confusion.