003 File Manager
Current Path:
/usr/src/contrib/llvm-project/clang/lib/AST/Interp
usr
/
src
/
contrib
/
llvm-project
/
clang
/
lib
/
AST
/
Interp
/
📁
..
📄
Boolean.h
(4.12 KB)
📄
ByteCodeEmitter.cpp
(5.38 KB)
📄
ByteCodeEmitter.h
(3.13 KB)
📄
ByteCodeExprGen.cpp
(16.6 KB)
📄
ByteCodeExprGen.h
(10.2 KB)
📄
ByteCodeGenError.cpp
(483 B)
📄
ByteCodeGenError.h
(1.36 KB)
📄
ByteCodeStmtGen.cpp
(7.21 KB)
📄
ByteCodeStmtGen.h
(2.39 KB)
📄
Context.cpp
(3.28 KB)
📄
Context.h
(2.39 KB)
📄
Descriptor.cpp
(10.31 KB)
📄
Descriptor.h
(7.82 KB)
📄
Disasm.cpp
(1.95 KB)
📄
EvalEmitter.cpp
(7.6 KB)
📄
EvalEmitter.h
(3.7 KB)
📄
Frame.cpp
(464 B)
📄
Frame.h
(1.28 KB)
📄
Function.cpp
(1.73 KB)
📄
Function.h
(4.91 KB)
📄
Integral.h
(8.38 KB)
📄
Interp.cpp
(11.54 KB)
📄
Interp.h
(30.64 KB)
📄
InterpBlock.cpp
(1.91 KB)
📄
InterpBlock.h
(4.11 KB)
📄
InterpFrame.cpp
(5.32 KB)
📄
InterpFrame.h
(4.54 KB)
📄
InterpStack.cpp
(1.81 KB)
📄
InterpStack.h
(3.43 KB)
📄
InterpState.cpp
(2.03 KB)
📄
InterpState.h
(3.29 KB)
📄
Opcode.h
(817 B)
📄
Opcodes.td
(11.02 KB)
📄
Pointer.cpp
(4.97 KB)
📄
Pointer.h
(11.08 KB)
📄
PrimType.cpp
(648 B)
📄
PrimType.h
(4.66 KB)
📄
Program.cpp
(11.29 KB)
📄
Program.h
(6.66 KB)
📄
Record.cpp
(1.54 KB)
📄
Record.h
(3.76 KB)
📄
Source.cpp
(1.15 KB)
📄
Source.h
(3.25 KB)
📄
State.cpp
(5.34 KB)
📄
State.h
(4.01 KB)
Editing: Record.h
//===--- Record.h - struct and class metadata for the VM --------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // A record is part of a program to describe the layout and methods of a struct. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_INTERP_RECORD_H #define LLVM_CLANG_AST_INTERP_RECORD_H #include "Pointer.h" namespace clang { namespace interp { class Program; /// Structure/Class descriptor. class Record { public: /// Describes a record field. struct Field { const FieldDecl *Decl; unsigned Offset; Descriptor *Desc; }; /// Describes a base class. struct Base { const RecordDecl *Decl; unsigned Offset; Descriptor *Desc; Record *R; }; /// Mapping from identifiers to field descriptors. using FieldList = llvm::SmallVector<Field, 8>; /// Mapping from identifiers to base classes. using BaseList = llvm::SmallVector<Base, 8>; /// List of virtual base classes. using VirtualBaseList = llvm::SmallVector<Base, 2>; public: /// Returns the underlying declaration. const RecordDecl *getDecl() const { return Decl; } /// Checks if the record is a union. bool isUnion() const { return getDecl()->isUnion(); } /// Returns the size of the record. unsigned getSize() const { return BaseSize; } /// Returns the full size of the record, including records. unsigned getFullSize() const { return BaseSize + VirtualSize; } /// Returns a field. const Field *getField(const FieldDecl *FD) const; /// Returns a base descriptor. const Base *getBase(const RecordDecl *FD) const; /// Returns a virtual base descriptor. const Base *getVirtualBase(const RecordDecl *RD) const; using const_field_iter = FieldList::const_iterator; llvm::iterator_range<const_field_iter> fields() const { return llvm::make_range(Fields.begin(), Fields.end()); } unsigned getNumFields() { return Fields.size(); } Field *getField(unsigned I) { return &Fields[I]; } using const_base_iter = BaseList::const_iterator; llvm::iterator_range<const_base_iter> bases() const { return llvm::make_range(Bases.begin(), Bases.end()); } unsigned getNumBases() { return Bases.size(); } Base *getBase(unsigned I) { return &Bases[I]; } using const_virtual_iter = VirtualBaseList::const_iterator; llvm::iterator_range<const_virtual_iter> virtual_bases() const { return llvm::make_range(VirtualBases.begin(), VirtualBases.end()); } unsigned getNumVirtualBases() { return VirtualBases.size(); } Base *getVirtualBase(unsigned I) { return &VirtualBases[I]; } private: /// Constructor used by Program to create record descriptors. Record(const RecordDecl *, BaseList &&Bases, FieldList &&Fields, VirtualBaseList &&VirtualBases, unsigned VirtualSize, unsigned BaseSize); private: friend class Program; /// Original declaration. const RecordDecl *Decl; /// List of all base classes. BaseList Bases; /// List of all the fields in the record. FieldList Fields; /// List o fall virtual bases. VirtualBaseList VirtualBases; /// Mapping from declarations to bases. llvm::DenseMap<const RecordDecl *, Base *> BaseMap; /// Mapping from field identifiers to descriptors. llvm::DenseMap<const FieldDecl *, Field *> FieldMap; /// Mapping from declarations to virtual bases. llvm::DenseMap<const RecordDecl *, Base *> VirtualBaseMap; /// Mapping from /// Size of the structure. unsigned BaseSize; /// Size of all virtual bases. unsigned VirtualSize; }; } // namespace interp } // namespace clang #endif
Upload File
Create Folder