LLVM  10.0.0svn
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,
22  : NativeRawSymbol(Session, PDB_SymType::ArrayType, Id), Record(Record),
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; }
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
This class represents lattice values for constants.
Definition: AllocatorList.h:23
SymIndexId getTypeId() const override
bool isVolatileType() const override
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
uint64_t getLength() const override
Class to represent array types.
Definition: DerivedTypes.h:408
A 32-bit type reference.
Definition: TypeIndex.h:95
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx.
Definition: PDBTypes.h:241
bool isUnalignedType() const override
uint32_t getCount() const override
void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent)
Definition: PDBExtras.h:48
void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value, int Indent, const IPDBSession &Session, PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags)
Definition: PDBSymbol.cpp:185
SymIndexId getArrayIndexTypeId() const override
NativeRawSymbol & getNativeSymbolById(SymIndexId SymbolId) const
SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI)
SymbolCache & getSymbolCache()
bool isConstType() const override
uint64_t getLength() const override
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45