LLVM  8.0.1
NativeTypeArray.cpp
Go to the documentation of this file.
1 //===- NativeTypeArray.cpp - info about arrays ------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 
15 
16 using namespace llvm;
17 using namespace llvm::codeview;
18 using namespace llvm::pdb;
19 
20 NativeTypeArray::NativeTypeArray(NativeSession &Session, SymIndexId Id,
23  : NativeRawSymbol(Session, PDB_SymType::ArrayType, Id), Record(Record),
24  Index(TI) {}
26 
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; }
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
This class represents lattice values for constants.
Definition: AllocatorList.h:24
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:369
A 32-bit type reference.
Definition: TypeIndex.h:96
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:183
bool isUnalignedType() const override
uint32_t getCount() const override
void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent)
Definition: PDBExtras.h:49
void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value, int Indent, const IPDBSession &Session, PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags)
Definition: PDBSymbol.cpp:186
SymIndexId getArrayIndexTypeId() const override
NativeRawSymbol & getNativeSymbolById(SymIndexId SymbolId) const
SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI)
SymbolCache & getSymbolCache()
Definition: JSON.cpp:598
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:46