LLVM  14.0.0git
NativeTypeArray.cpp
Go to the documentation of this file.
1 //===- NativeTypeArray.cpp - info about arrays ------------------*- 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 
10 
14 
15 using namespace llvm;
16 using namespace llvm::codeview;
17 using namespace llvm::pdb;
18 
19 NativeTypeArray::NativeTypeArray(NativeSession &Session, SymIndexId Id,
23  Index(TI) {}
25 
26 void NativeTypeArray::dump(raw_ostream &OS, int Indent,
27  PdbSymbolIdField ShowIdFields,
28  PdbSymbolIdField RecurseIdFields) const {
29  NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);
30 
31  dumpSymbolField(OS, "arrayIndexTypeId", getArrayIndexTypeId(), Indent);
32  dumpSymbolIdField(OS, "elementTypeId", getTypeId(), Indent, Session,
33  PdbSymbolIdField::Type, ShowIdFields, RecurseIdFields);
34 
35  dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,
36  PdbSymbolIdField::LexicalParent, ShowIdFields,
37  RecurseIdFields);
38  dumpSymbolField(OS, "length", getLength(), Indent);
39  dumpSymbolField(OS, "count", getCount(), Indent);
40  dumpSymbolField(OS, "constType", isConstType(), Indent);
41  dumpSymbolField(OS, "unalignedType", isUnalignedType(), Indent);
42  dumpSymbolField(OS, "volatileType", isVolatileType(), Indent);
43 }
44 
46  return Session.getSymbolCache().findSymbolByTypeIndex(Record.getIndexType());
47 }
48 
49 bool NativeTypeArray::isConstType() const { return false; }
50 
51 bool NativeTypeArray::isUnalignedType() const { return false; }
52 
53 bool NativeTypeArray::isVolatileType() const { return false; }
54 
56  NativeRawSymbol &Element =
58  return getLength() / Element.getLength();
59 }
60 
63  Record.getElementType());
64 }
65 
66 uint64_t NativeTypeArray::getLength() const { return Record.Size; }
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::pdb::NativeTypeArray::~NativeTypeArray
~NativeTypeArray() override
Definition: NativeTypeArray.cpp:24
llvm::pdb::NativeTypeArray::isConstType
bool isConstType() const override
Definition: NativeTypeArray.cpp:49
NativeTypeArray.h
SymbolRecord.h
llvm::pdb::PdbSymbolIdField::Type
@ Type
llvm::pdb::NativeTypeArray::getCount
uint32_t getCount() const override
Definition: NativeTypeArray.cpp:55
llvm::pdb::NativeTypeArray::isVolatileType
bool isVolatileType() const override
Definition: NativeTypeArray.cpp:53
llvm::pdb::NativeTypeArray::isUnalignedType
bool isUnalignedType() const override
Definition: NativeTypeArray.cpp:51
llvm::ArrayType
Class to represent array types.
Definition: DerivedTypes.h:357
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::NativeRawSymbol::getLength
uint64_t getLength() const override
Definition: NativeRawSymbol.cpp:392
llvm::pdb::PdbSymbolIdField::LexicalParent
@ LexicalParent
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
Definition: ConcreteSymbolEnumerator.h:20
llvm::pdb::NativeTypeArray::getLength
uint64_t getLength() const override
Definition: NativeTypeArray.cpp:66
llvm::pdb::NativeTypeArray::dump
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
Definition: NativeTypeArray.cpp:26
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
uint64_t
llvm::pdb::NativeTypeArray::getArrayIndexTypeId
SymIndexId getArrayIndexTypeId() const override
Definition: NativeTypeArray.cpp:45
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::pdb::NativeSession::getSymbolCache
SymbolCache & getSymbolCache()
Definition: NativeSession.h:109
llvm::pdb::NativeTypeArray::getTypeId
SymIndexId getTypeId() const override
Definition: NativeTypeArray.cpp:61
llvm::Record
Definition: Record.h:1472
uint32_t
llvm::pdb::SymbolCache::findSymbolByTypeIndex
SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI) const
Definition: SymbolCache.cpp:153
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
NativeTypeEnum.h
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
llvm::pdb::PdbSymbolIdField
PdbSymbolIdField
Definition: IPDBRawSymbol.h:24
NativeTypeBuiltin.h
llvm::codeview::ArrayRecord
Definition: TypeRecord.h:395
llvm::codeview::TypeIndex
A 32-bit type reference.
Definition: TypeIndex.h:96
llvm::pdb::SymbolCache::getNativeSymbolById
NativeRawSymbol & getNativeSymbolById(SymIndexId SymbolId) const
Definition: SymbolCache.cpp:258
llvm::pdb::NativeRawSymbol::Session
NativeSession & Session
Definition: NativeRawSymbol.h:232
llvm::AMDGPU::VGPRIndexMode::Id
Id
Definition: SIDefines.h:231
llvm::pdb::NativeRawSymbol
Definition: NativeRawSymbol.h:21