source: src/Parser/TypeData.h @ 8217e8f

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 8217e8f was 8217e8f, checked in by Rob Schluntz <rschlunt@…>, 7 years ago

Merge branch 'master' into references

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[b87a5ed]1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
[148f7290]7// TypeData.h --
[b87a5ed]8//
9// Author           : Rodolfo G. Esteves
10// Created On       : Sat May 16 15:18:36 2015
[bd46af4]11// Last Modified By : Andrew Beach
12// Last Modified On : Mon Aug 14 10:38:00 2017
13// Update Count     : 189
[b87a5ed]14//
15
[6b0b624]16#pragma once
[51b7345]17
18#include "ParseNode.h"
19#include "SynTree/Type.h"
20
[c8ffe20b]21struct TypeData {
[ce8c12f]22        enum Kind { Basic, Pointer, Array, Reference, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,
[faddbd8]23                                SymbolicInst, Tuple, Typeof, Builtin, Unknown };
[b87a5ed]24
25        struct Aggregate_t {
[68cd1ce]26                DeclarationNode::Aggregate kind;
[2298f728]27                const std::string * name;
[7ee14bb7]28                DeclarationNode * params;
[2298f728]29                ExpressionNode * actuals;                                               // holds actual parameters later applied to AggInst
[7ee14bb7]30                DeclarationNode * fields;
[5d125e4]31                bool body;
[6ea87486]32
33                bool tagged;
34                const std::string * parent;
[b87a5ed]35        };
36
37        struct AggInst_t {
[7ee14bb7]38                TypeData * aggregate;
39                ExpressionNode * params;
[43c89a7]40                bool hoistType;
[b87a5ed]41        };
42
43        struct Array_t {
[7ee14bb7]44                ExpressionNode * dimension;
[b87a5ed]45                bool isVarLen;
46                bool isStatic;
47        };
48
49        struct Enumeration_t {
[2298f728]50                const std::string * name;
[7ee14bb7]51                DeclarationNode * constants;
[ca1a547]52                bool body;
[b87a5ed]53        };
54
55        struct Function_t {
[3a5131ed]56                mutable DeclarationNode * params;                               // mutables modified in buildKRFunction
57                mutable DeclarationNode * idList;                               // old-style
58                mutable DeclarationNode * oldDeclList;
[7ee14bb7]59                StatementNode * body;
[b87a5ed]60                bool newStyle;
61        };
62
63        struct Symbolic_t {
[2298f728]64                const std::string * name;
[721f17a]65                bool isTypedef;                                                                 // false => TYPEGENname, true => TYPEDEFname
[7ee14bb7]66                DeclarationNode * params;
67                ExpressionNode * actuals;
68                DeclarationNode * assertions;
[b87a5ed]69        };
70
[28307be]71        Kind kind;
[413ad05]72        TypeData * base;
[5b639ee]73        DeclarationNode::BasicType basictype = DeclarationNode::NoBasicType;
74        DeclarationNode::ComplexType complextype = DeclarationNode::NoComplexType;
75        DeclarationNode::Signedness signedness = DeclarationNode::NoSignedness;
76        DeclarationNode::Length length = DeclarationNode::NoLength;
[148f7290]77        DeclarationNode::BuiltinType builtintype = DeclarationNode::NoBuiltinType;
[c3396e0]78
[738e304]79        Type::Qualifiers qualifiers;
[413ad05]80        DeclarationNode * forall;
81
[c3396e0]82        // Basic_t basic;
83        Aggregate_t aggregate;
84        AggInst_t aggInst;
85        Array_t array;
86        Enumeration_t enumeration;
87        // Variable_t variable;
88        Function_t function;
89        Symbolic_t symbolic;
90        DeclarationNode * tuple;
91        ExpressionNode * typeexpr;
[b87a5ed]92
[413ad05]93        TypeData( Kind k = Unknown );
94        ~TypeData();
95        void print( std::ostream &, int indent = 0 ) const;
96        TypeData * clone() const;
[51b7345]97};
98
[413ad05]99Type * typebuild( const TypeData * );
100TypeData * typeextractAggregate( const TypeData * td, bool toplevel = true );
101Type::Qualifiers buildQualifiers( const TypeData * td );
102Type * buildBasicType( const TypeData * );
103PointerType * buildPointer( const TypeData * );
104ArrayType * buildArray( const TypeData * );
[ce8c12f]105ReferenceType * buildReference( const TypeData * );
[c0aa336]106AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > );
[fa4805f]107ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes, LinkageSpec::Spec linkage );
[413ad05]108ReferenceToType * buildAggInst( const TypeData * );
109TypeDecl * buildVariable( const TypeData * );
[bd46af4]110EnumDecl * buildEnum( const TypeData *, std::list< Attribute * >, LinkageSpec::Spec );
[413ad05]111TypeInstType * buildSymbolicInst( const TypeData * );
112TupleType * buildTuple( const TypeData * );
113TypeofType * buildTypeof( const TypeData * );
[ddfd945]114Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, ConstantExpr *asmName, Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() );
[413ad05]115FunctionType * buildFunction( const TypeData * );
[3a5131ed]116void buildKRFunction( const TypeData::Function_t & function );
[413ad05]117
[b87a5ed]118// Local Variables: //
119// tab-width: 4 //
120// mode: c++ //
121// compile-command: "make install" //
122// End: //
Note: See TracBrowser for help on using the repository browser.