annotate lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 #include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 #include "llvm/ADT/STLExtras.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 namespace llvm {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 namespace pdb {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 SymIndexId SymbolId,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 DbiModuleDescriptor MI)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 : NativeRawSymbol(Session, SymbolId), Module(MI) {}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 PDB_SymType NativeCompilandSymbol::getSymTag() const {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 return PDB_SymType::Compiland;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 std::unique_ptr<NativeRawSymbol> NativeCompilandSymbol::clone() const {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 return llvm::make_unique<NativeCompilandSymbol>(Session, SymbolId, Module);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 bool NativeCompilandSymbol::isEditAndContinueEnabled() const {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 return Module.hasECInfo();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 uint32_t NativeCompilandSymbol::getLexicalParentId() const { return 0; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 // The usage of getObjFileName for getLibraryName and getModuleName for getName
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 // may seem backwards, but it is consistent with DIA, which is what this API
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 // was modeled after. We may rename these methods later to try to eliminate
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 // this potential confusion.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 std::string NativeCompilandSymbol::getLibraryName() const {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 return Module.getObjFileName();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 std::string NativeCompilandSymbol::getName() const {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 return Module.getModuleName();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 } // namespace pdb
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 } // namespace llvm