Adrian McCarthy | ad6d60a | 2017-03-15 20:29:06 +0000 | [diff] [blame] | 1 | //===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===// |
Adrian McCarthy | 65d2688 | 2017-03-15 20:17:58 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h" |
| 11 | |
| 12 | namespace llvm { |
| 13 | namespace pdb { |
| 14 | |
| 15 | NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session, |
Zachary Turner | 1eb9a02 | 2017-05-04 23:53:29 +0000 | [diff] [blame^] | 16 | DbiModuleDescriptor MI) |
Adrian McCarthy | 65d2688 | 2017-03-15 20:17:58 +0000 | [diff] [blame] | 17 | : NativeRawSymbol(Session), Module(MI) {} |
| 18 | |
| 19 | PDB_SymType NativeCompilandSymbol::getSymTag() const { |
| 20 | return PDB_SymType::Compiland; |
| 21 | } |
| 22 | |
| 23 | bool NativeCompilandSymbol::isEditAndContinueEnabled() const { |
Zachary Turner | 1eb9a02 | 2017-05-04 23:53:29 +0000 | [diff] [blame^] | 24 | return Module.hasECInfo(); |
Adrian McCarthy | 65d2688 | 2017-03-15 20:17:58 +0000 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | uint32_t NativeCompilandSymbol::getLexicalParentId() const { return 0; } |
| 28 | |
Adrian McCarthy | ad6d60a | 2017-03-15 20:29:06 +0000 | [diff] [blame] | 29 | // The usage of getObjFileName for getLibraryName and getModuleName for getName |
| 30 | // may seem backwards, but it is consistent with DIA, which is what this API |
| 31 | // was modeled after. We may rename these methods later to try to eliminate |
| 32 | // this potential confusion. |
Adrian McCarthy | 65d2688 | 2017-03-15 20:17:58 +0000 | [diff] [blame] | 33 | |
| 34 | std::string NativeCompilandSymbol::getLibraryName() const { |
Zachary Turner | 1eb9a02 | 2017-05-04 23:53:29 +0000 | [diff] [blame^] | 35 | return Module.getObjFileName(); |
Adrian McCarthy | 65d2688 | 2017-03-15 20:17:58 +0000 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | std::string NativeCompilandSymbol::getName() const { |
Zachary Turner | 1eb9a02 | 2017-05-04 23:53:29 +0000 | [diff] [blame^] | 39 | return Module.getModuleName(); |
Adrian McCarthy | 65d2688 | 2017-03-15 20:17:58 +0000 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | } // namespace pdb |
| 43 | } // namespace llvm |