LLVM 22.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
15using namespace llvm;
16using namespace llvm::codeview;
17using namespace llvm::pdb;
18
25
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,
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
49bool NativeTypeArray::isConstType() const { return false; }
50
51bool NativeTypeArray::isUnalignedType() const { return false; }
52
53bool NativeTypeArray::isVolatileType() const { return false; }
54
56 NativeRawSymbol &Element =
57 Session.getSymbolCache().getNativeSymbolById(getTypeId());
58 return getLength() / Element.getLength();
59}
60
62 return Session.getSymbolCache().findSymbolByTypeIndex(
63 Record.getElementType());
64}
65
A 32-bit type reference.
Definition TypeIndex.h:97
uint64_t getLength() const override
NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag, SymIndexId SymbolId)
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
bool isVolatileType() const override
bool isUnalignedType() const override
codeview::TypeIndex Index
uint64_t getLength() const override
bool isConstType() const override
SymIndexId getArrayIndexTypeId() const override
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
uint32_t getCount() const override
codeview::ArrayRecord Record
SymIndexId getTypeId() const override
NativeTypeArray(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI, codeview::ArrayRecord Record)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
uint32_t SymIndexId
Definition PDBTypes.h:26
void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent)
Definition PDBExtras.h:51
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....
Definition PDBTypes.h:243
LLVM_ABI void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value, int Indent, const IPDBSession &Session, PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags)
This is an optimization pass for GlobalISel generic memory operations.