LLVM  15.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 
15 
16 using namespace llvm;
17 using namespace llvm::codeview;
18 using namespace llvm::pdb;
19 
20 NativeTypeArray::NativeTypeArray(NativeSession &Session, SymIndexId Id,
24  Index(TI) {}
26 
27 void NativeTypeArray::dump(raw_ostream &OS, int Indent,
28  PdbSymbolIdField ShowIdFields,
29  PdbSymbolIdField RecurseIdFields) const {
30  NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);
31 
32  dumpSymbolField(OS, "arrayIndexTypeId", getArrayIndexTypeId(), Indent);
33  dumpSymbolIdField(OS, "elementTypeId", getTypeId(), Indent, Session,
34  PdbSymbolIdField::Type, ShowIdFields, RecurseIdFields);
35 
36  dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,
37  PdbSymbolIdField::LexicalParent, ShowIdFields,
38  RecurseIdFields);
39  dumpSymbolField(OS, "length", getLength(), Indent);
40  dumpSymbolField(OS, "count", getCount(), Indent);
41  dumpSymbolField(OS, "constType", isConstType(), Indent);
42  dumpSymbolField(OS, "unalignedType", isUnalignedType(), Indent);
43  dumpSymbolField(OS, "volatileType", isVolatileType(), Indent);
44 }
45 
47  return Session.getSymbolCache().findSymbolByTypeIndex(Record.getIndexType());
48 }
49 
50 bool NativeTypeArray::isConstType() const { return false; }
51 
52 bool NativeTypeArray::isUnalignedType() const { return false; }
53 
54 bool NativeTypeArray::isVolatileType() const { return false; }
55 
57  NativeRawSymbol &Element =
59  return getLength() / Element.getLength();
60 }
61 
64  Record.getElementType());
65 }
66 
67 uint64_t NativeTypeArray::getLength() const { return Record.Size; }
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::pdb::NativeTypeArray::~NativeTypeArray
~NativeTypeArray() override
llvm::pdb::NativeTypeArray::isConstType
bool isConstType() const override
Definition: NativeTypeArray.cpp:50
NativeTypeArray.h
llvm::pdb::PdbSymbolIdField::Type
@ Type
llvm::pdb::NativeTypeArray::getCount
uint32_t getCount() const override
Definition: NativeTypeArray.cpp:56
llvm::pdb::NativeTypeArray::isVolatileType
bool isVolatileType() const override
Definition: NativeTypeArray.cpp:54
llvm::pdb::NativeTypeArray::isUnalignedType
bool isUnalignedType() const override
Definition: NativeTypeArray.cpp:52
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:391
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:54
CodeView.h
llvm::pdb
Definition: ConcreteSymbolEnumerator.h:20
llvm::pdb::NativeTypeArray::getLength
uint64_t getLength() const override
Definition: NativeTypeArray.cpp:67
llvm::pdb::NativeTypeArray::dump
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
Definition: NativeTypeArray.cpp:27
uint64_t
llvm::pdb::NativeTypeArray::getArrayIndexTypeId
SymIndexId getArrayIndexTypeId() const override
Definition: NativeTypeArray.cpp:46
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:113
llvm::pdb::NativeTypeArray::getTypeId
SymIndexId getTypeId() const override
Definition: NativeTypeArray.cpp:62
llvm::Record
Definition: Record.h:1508
uint32_t
llvm::pdb::SymbolCache::findSymbolByTypeIndex
SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI) const
Definition: SymbolCache.cpp:158
llvm::pdb::NativeRawSymbol::dump
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
Definition: NativeRawSymbol.cpp:21
llvm::pdb::NativeSession
Definition: NativeSession.h:32
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
llvm::pdb::PdbSymbolIdField
PdbSymbolIdField
Definition: IPDBRawSymbol.h:24
llvm::codeview::ArrayRecord
Definition: TypeRecord.h:396
PDBExtras.h
SymbolCache.h
llvm::codeview::TypeIndex
A 32-bit type reference.
Definition: TypeIndex.h:96
llvm::pdb::SymbolCache::getNativeSymbolById
NativeRawSymbol & getNativeSymbolById(SymIndexId SymbolId) const
Definition: SymbolCache.cpp:263
llvm::pdb::NativeRawSymbol::Session
NativeSession & Session
Definition: NativeRawSymbol.h:232
llvm::AMDGPU::VGPRIndexMode::Id
Id
Definition: SIDefines.h:235
llvm::pdb::NativeRawSymbol
Definition: NativeRawSymbol.h:21
NativeSession.h