1 | //===- NativeTypeBuiltin.cpp -------------------------------------- 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 | |
9 | #include "llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h" |
10 | |
11 | using namespace llvm; |
12 | using namespace llvm::codeview; |
13 | using namespace llvm::pdb; |
14 | |
15 | NativeTypeBuiltin::NativeTypeBuiltin(NativeSession &PDBSession, SymIndexId Id, |
16 | ModifierOptions Mods, PDB_BuiltinType T, |
17 | uint64_t L) |
18 | : NativeRawSymbol(PDBSession, PDB_SymType::BuiltinType, Id), |
19 | Session(PDBSession), Mods(Mods), Type(T), Length(L) {} |
20 | |
21 | NativeTypeBuiltin::~NativeTypeBuiltin() = default; |
22 | |
23 | void NativeTypeBuiltin::dump(raw_ostream &OS, int Indent, |
24 | PdbSymbolIdField ShowIdFields, |
25 | PdbSymbolIdField RecurseIdFields) const {} |
26 | |
27 | PDB_SymType NativeTypeBuiltin::getSymTag() const { |
28 | return PDB_SymType::BuiltinType; |
29 | } |
30 | |
31 | PDB_BuiltinType NativeTypeBuiltin::getBuiltinType() const { return Type; } |
32 | |
33 | bool NativeTypeBuiltin::isConstType() const { |
34 | return (Mods & ModifierOptions::Const) != ModifierOptions::None; |
35 | } |
36 | |
37 | uint64_t NativeTypeBuiltin::getLength() const { return Length; } |
38 | |
39 | bool NativeTypeBuiltin::isUnalignedType() const { |
40 | return (Mods & ModifierOptions::Unaligned) != ModifierOptions::None; |
41 | } |
42 | |
43 | bool NativeTypeBuiltin::isVolatileType() const { |
44 | return (Mods & ModifierOptions::Volatile) != ModifierOptions::None; |
45 | } |
46 | |