1 //===- NativeRawSymbol.cpp - Native implementation of IPDBRawSymbol -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
11 #include "llvm/ADT/ArrayRef.h"
12 #include "llvm/ADT/STLExtras.h"
13 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
14 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
15 #include "llvm/DebugInfo/PDB/PDBExtras.h"
16 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
17 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
18 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
19 #include "llvm/Support/ConvertUTF.h"
20 #include "llvm/Support/raw_ostream.h"
23 using namespace llvm::pdb;
25 NativeRawSymbol::NativeRawSymbol(NativeSession &PDBSession)
26 : Session(PDBSession) {}
28 void NativeRawSymbol::dump(raw_ostream &OS, int Indent) const {}
30 std::unique_ptr<IPDBEnumSymbols>
31 NativeRawSymbol::findChildren(PDB_SymType Type) const {
35 std::unique_ptr<IPDBEnumSymbols>
36 NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name,
37 PDB_NameSearchFlags Flags) const {
41 std::unique_ptr<IPDBEnumSymbols>
42 NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
43 PDB_NameSearchFlags Flags, uint32_t RVA) const {
47 std::unique_ptr<IPDBEnumSymbols>
48 NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
52 void NativeRawSymbol::getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes) const {
56 PDB_MemberAccess NativeRawSymbol::getAccess() const {
57 return PDB_MemberAccess::Private;
60 uint32_t NativeRawSymbol::getAddressOffset() const {
64 uint32_t NativeRawSymbol::getAddressSection() const {
68 uint32_t NativeRawSymbol::getAge() const {
72 uint32_t NativeRawSymbol::getArrayIndexTypeId() const {
76 void NativeRawSymbol::getBackEndVersion(VersionInfo &Version) const {
83 uint32_t NativeRawSymbol::getBaseDataOffset() const {
87 uint32_t NativeRawSymbol::getBaseDataSlot() const {
91 uint32_t NativeRawSymbol::getBaseSymbolId() const {
95 PDB_BuiltinType NativeRawSymbol::getBuiltinType() const {
96 return PDB_BuiltinType::None;
99 uint32_t NativeRawSymbol::getBitPosition() const {
103 PDB_CallingConv NativeRawSymbol::getCallingConvention() const {
104 return PDB_CallingConv::FarStdCall;
107 uint32_t NativeRawSymbol::getClassParentId() const {
111 std::string NativeRawSymbol::getCompilerName() const {
115 uint32_t NativeRawSymbol::getCount() const {
119 uint32_t NativeRawSymbol::getCountLiveRanges() const {
123 void NativeRawSymbol::getFrontEndVersion(VersionInfo &Version) const {
130 PDB_Lang NativeRawSymbol::getLanguage() const {
131 return PDB_Lang::Cobol;
134 uint32_t NativeRawSymbol::getLexicalParentId() const {
138 std::string NativeRawSymbol::getLibraryName() const {
142 uint32_t NativeRawSymbol::getLiveRangeStartAddressOffset() const {
146 uint32_t NativeRawSymbol::getLiveRangeStartAddressSection() const {
150 uint32_t NativeRawSymbol::getLiveRangeStartRelativeVirtualAddress() const {
154 codeview::RegisterId NativeRawSymbol::getLocalBasePointerRegisterId() const {
155 return codeview::RegisterId::EAX;
158 uint32_t NativeRawSymbol::getLowerBoundId() const {
162 uint32_t NativeRawSymbol::getMemorySpaceKind() const {
166 std::string NativeRawSymbol::getName() const {
170 uint32_t NativeRawSymbol::getNumberOfAcceleratorPointerTags() const {
174 uint32_t NativeRawSymbol::getNumberOfColumns() const {
178 uint32_t NativeRawSymbol::getNumberOfModifiers() const {
182 uint32_t NativeRawSymbol::getNumberOfRegisterIndices() const {
186 uint32_t NativeRawSymbol::getNumberOfRows() const {
190 std::string NativeRawSymbol::getObjectFileName() const {
194 uint32_t NativeRawSymbol::getOemId() const {
198 uint32_t NativeRawSymbol::getOemSymbolId() const {
202 uint32_t NativeRawSymbol::getOffsetInUdt() const {
206 PDB_Cpu NativeRawSymbol::getPlatform() const {
207 return PDB_Cpu::Intel8080;
210 uint32_t NativeRawSymbol::getRank() const {
214 codeview::RegisterId NativeRawSymbol::getRegisterId() const {
215 return codeview::RegisterId::EAX;
218 uint32_t NativeRawSymbol::getRegisterType() const {
222 uint32_t NativeRawSymbol::getRelativeVirtualAddress() const {
226 uint32_t NativeRawSymbol::getSamplerSlot() const {
230 uint32_t NativeRawSymbol::getSignature() const {
234 uint32_t NativeRawSymbol::getSizeInUdt() const {
238 uint32_t NativeRawSymbol::getSlot() const {
242 std::string NativeRawSymbol::getSourceFileName() const {
246 uint32_t NativeRawSymbol::getStride() const {
250 uint32_t NativeRawSymbol::getSubTypeId() const {
254 std::string NativeRawSymbol::getSymbolsFileName() const { return ""; }
256 uint32_t NativeRawSymbol::getSymIndexId() const {
260 uint32_t NativeRawSymbol::getTargetOffset() const {
264 uint32_t NativeRawSymbol::getTargetRelativeVirtualAddress() const {
268 uint64_t NativeRawSymbol::getTargetVirtualAddress() const {
272 uint32_t NativeRawSymbol::getTargetSection() const {
276 uint32_t NativeRawSymbol::getTextureSlot() const {
280 uint32_t NativeRawSymbol::getTimeStamp() const {
284 uint32_t NativeRawSymbol::getToken() const {
288 uint32_t NativeRawSymbol::getTypeId() const {
292 uint32_t NativeRawSymbol::getUavSlot() const {
296 std::string NativeRawSymbol::getUndecoratedName() const {
300 uint32_t NativeRawSymbol::getUnmodifiedTypeId() const {
304 uint32_t NativeRawSymbol::getUpperBoundId() const {
308 Variant NativeRawSymbol::getValue() const {
312 uint32_t NativeRawSymbol::getVirtualBaseDispIndex() const {
316 uint32_t NativeRawSymbol::getVirtualBaseOffset() const {
320 uint32_t NativeRawSymbol::getVirtualTableShapeId() const {
324 std::unique_ptr<PDBSymbolTypeBuiltin>
325 NativeRawSymbol::getVirtualBaseTableType() const {
329 PDB_DataKind NativeRawSymbol::getDataKind() const {
330 return PDB_DataKind::Unknown;
333 PDB_SymType NativeRawSymbol::getSymTag() const {
334 return PDB_SymType::None;
337 PDB_UniqueId NativeRawSymbol::getGuid() const {
338 return PDB_UniqueId{{0}};
341 int32_t NativeRawSymbol::getOffset() const {
345 int32_t NativeRawSymbol::getThisAdjust() const {
349 int32_t NativeRawSymbol::getVirtualBasePointerOffset() const {
353 PDB_LocType NativeRawSymbol::getLocationType() const {
354 return PDB_LocType::Null;
357 PDB_Machine NativeRawSymbol::getMachineType() const {
358 return PDB_Machine::Invalid;
361 codeview::ThunkOrdinal NativeRawSymbol::getThunkOrdinal() const {
362 return codeview::ThunkOrdinal::Standard;
365 uint64_t NativeRawSymbol::getLength() const {
369 uint64_t NativeRawSymbol::getLiveRangeLength() const {
373 uint64_t NativeRawSymbol::getVirtualAddress() const {
377 PDB_UdtType NativeRawSymbol::getUdtKind() const {
378 return PDB_UdtType::Struct;
381 bool NativeRawSymbol::hasConstructor() const {
385 bool NativeRawSymbol::hasCustomCallingConvention() const {
389 bool NativeRawSymbol::hasFarReturn() const {
393 bool NativeRawSymbol::isCode() const {
397 bool NativeRawSymbol::isCompilerGenerated() const {
401 bool NativeRawSymbol::isConstType() const {
405 bool NativeRawSymbol::isEditAndContinueEnabled() const {
409 bool NativeRawSymbol::isFunction() const {
413 bool NativeRawSymbol::getAddressTaken() const {
417 bool NativeRawSymbol::getNoStackOrdering() const {
421 bool NativeRawSymbol::hasAlloca() const {
425 bool NativeRawSymbol::hasAssignmentOperator() const {
429 bool NativeRawSymbol::hasCTypes() const {
433 bool NativeRawSymbol::hasCastOperator() const {
437 bool NativeRawSymbol::hasDebugInfo() const {
441 bool NativeRawSymbol::hasEH() const {
445 bool NativeRawSymbol::hasEHa() const {
449 bool NativeRawSymbol::hasInlAsm() const {
453 bool NativeRawSymbol::hasInlineAttribute() const {
457 bool NativeRawSymbol::hasInterruptReturn() const {
461 bool NativeRawSymbol::hasFramePointer() const {
465 bool NativeRawSymbol::hasLongJump() const {
469 bool NativeRawSymbol::hasManagedCode() const {
473 bool NativeRawSymbol::hasNestedTypes() const {
477 bool NativeRawSymbol::hasNoInlineAttribute() const {
481 bool NativeRawSymbol::hasNoReturnAttribute() const {
485 bool NativeRawSymbol::hasOptimizedCodeDebugInfo() const {
489 bool NativeRawSymbol::hasOverloadedOperator() const {
493 bool NativeRawSymbol::hasSEH() const {
497 bool NativeRawSymbol::hasSecurityChecks() const {
501 bool NativeRawSymbol::hasSetJump() const {
505 bool NativeRawSymbol::hasStrictGSCheck() const {
509 bool NativeRawSymbol::isAcceleratorGroupSharedLocal() const {
513 bool NativeRawSymbol::isAcceleratorPointerTagLiveRange() const {
517 bool NativeRawSymbol::isAcceleratorStubFunction() const {
521 bool NativeRawSymbol::isAggregated() const {
525 bool NativeRawSymbol::isIntroVirtualFunction() const {
529 bool NativeRawSymbol::isCVTCIL() const {
533 bool NativeRawSymbol::isConstructorVirtualBase() const {
537 bool NativeRawSymbol::isCxxReturnUdt() const {
541 bool NativeRawSymbol::isDataAligned() const {
545 bool NativeRawSymbol::isHLSLData() const {
549 bool NativeRawSymbol::isHotpatchable() const {
553 bool NativeRawSymbol::isIndirectVirtualBaseClass() const {
557 bool NativeRawSymbol::isInterfaceUdt() const {
561 bool NativeRawSymbol::isIntrinsic() const {
565 bool NativeRawSymbol::isLTCG() const {
569 bool NativeRawSymbol::isLocationControlFlowDependent() const {
573 bool NativeRawSymbol::isMSILNetmodule() const {
577 bool NativeRawSymbol::isMatrixRowMajor() const {
581 bool NativeRawSymbol::isManagedCode() const {
585 bool NativeRawSymbol::isMSILCode() const {
589 bool NativeRawSymbol::isMultipleInheritance() const {
593 bool NativeRawSymbol::isNaked() const {
597 bool NativeRawSymbol::isNested() const {
601 bool NativeRawSymbol::isOptimizedAway() const {
605 bool NativeRawSymbol::isPacked() const {
609 bool NativeRawSymbol::isPointerBasedOnSymbolValue() const {
613 bool NativeRawSymbol::isPointerToDataMember() const {
617 bool NativeRawSymbol::isPointerToMemberFunction() const {
621 bool NativeRawSymbol::isPureVirtual() const {
625 bool NativeRawSymbol::isRValueReference() const {
629 bool NativeRawSymbol::isRefUdt() const {
633 bool NativeRawSymbol::isReference() const {
637 bool NativeRawSymbol::isRestrictedType() const {
641 bool NativeRawSymbol::isReturnValue() const {
645 bool NativeRawSymbol::isSafeBuffers() const {
649 bool NativeRawSymbol::isScoped() const {
653 bool NativeRawSymbol::isSdl() const {
657 bool NativeRawSymbol::isSingleInheritance() const {
661 bool NativeRawSymbol::isSplitted() const {
665 bool NativeRawSymbol::isStatic() const {
669 bool NativeRawSymbol::hasPrivateSymbols() const {
673 bool NativeRawSymbol::isUnalignedType() const {
677 bool NativeRawSymbol::isUnreached() const {
681 bool NativeRawSymbol::isValueUdt() const {
685 bool NativeRawSymbol::isVirtual() const {
689 bool NativeRawSymbol::isVirtualBaseClass() const {
693 bool NativeRawSymbol::isVirtualInheritance() const {
697 bool NativeRawSymbol::isVolatileType() const {
701 bool NativeRawSymbol::wasInlined() const {
705 std::string NativeRawSymbol::getUnused() const {