Changeset 8135d4c for src/SynTree


Ignore:
Timestamp:
Aug 22, 2017, 7:31:52 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
9aaac6e9
Parents:
fc56cdbf (diff), b3d413b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into references

Location:
src/SynTree
Files:
49 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/AddStmtVisitor.cc

    rfc56cdbf r8135d4c  
    1515
    1616#include "AddStmtVisitor.h"
    17 #include "Statement.h"
    18 #include "Declaration.h"
    19 #include "Expression.h"
    20 #include "Common/utility.h"
     17
     18#include "Common/SemanticError.h"  // for SemanticError
     19#include "Declaration.h"           // for Declaration
     20#include "Expression.h"            // for Expression
     21#include "Statement.h"             // for CompoundStmt, ForStmt, IfStmt, Sta...
     22#include "SynTree/Label.h"         // for Label, noLabels
    2123
    2224void AddStmtVisitor::visitStatementList( std::list< Statement* > &statements ) {
  • src/SynTree/AddStmtVisitor.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include <list>
     18#include <list>               // for list
    1919
    20 #include "SynTree/SynTree.h"
    21 #include "SynTree/Visitor.h"
     20#include "SynTree/SynTree.h"  // for Visitor Nodes
     21#include "SynTree/Visitor.h"  // for Visitor
    2222
    2323class AddStmtVisitor : public Visitor {
  • src/SynTree/AddressExpr.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Expression.h"
    17 #include "Type.h"
    18 #include "Common/utility.h"
     16#include <ostream>           // for ostream, operator<<, basic_ostream, endl
     17#include <string>            // for operator<<, string
     18
     19#include "Common/utility.h"  // for maybeClone
     20#include "Expression.h"      // for AddressExpr, Expression
     21#include "Type.h"            // for PointerType, Type, Type::Qualifiers
    1922
    2023// Address expressions are typed based on the following inference rules:
  • src/SynTree/AggregateDecl.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Declaration.h"
    17 #include "Attribute.h"
    18 #include "Type.h"
    19 #include "Common/utility.h"
     16#include <list>                  // for list
     17#include <ostream>               // for operator<<, basic_ostream, ostream
     18#include <string>                // for operator<<, string, char_traits
     19
     20#include "Attribute.h"           // for Attribute
     21#include "Common/utility.h"      // for printAll, cloneAll, deleteAll
     22#include "Declaration.h"         // for AggregateDecl, TypeDecl, Declaration
     23#include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
     24#include "Type.h"                // for Type, Type::StorageClasses
    2025
    2126
  • src/SynTree/ApplicationExpr.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <cassert>
     16#include <cassert>               // for safe_dynamic_cast, assert
     17#include <list>                  // for list
     18#include <map>                   // for _Rb_tree_const_iterator, map, map<>:...
     19#include <memory>                // for unique_ptr
     20#include <ostream>               // for operator<<, ostream, basic_ostream
     21#include <string>                // for operator<<, string, char_traits
     22#include <utility>               // for pair
    1723
    18 #include "Expression.h"
    19 #include "Declaration.h"
    20 #include "Type.h"
    21 #include "TypeSubstitution.h"
    22 #include "Common/utility.h"
    23 #include "ResolvExpr/typeops.h"
     24#include "Common/utility.h"      // for maybeClone, cloneAll, deleteAll, pri...
     25#include "Declaration.h"         // for Declaration
     26#include "Expression.h"          // for ParamEntry, ApplicationExpr, Expression
     27#include "ResolvExpr/typeops.h"  // for extractResultType
     28#include "Type.h"                // for Type, PointerType, FunctionType
    2429
    2530ParamEntry::ParamEntry( const ParamEntry &other ) :
  • src/SynTree/ArrayType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Type.h"
    17 #include "Expression.h"
    18 #include "Common/utility.h"
     16#include <list>              // for list
     17#include <ostream>           // for operator<<, ostream
     18
     19#include "Common/utility.h"  // for maybeClone
     20#include "Expression.h"      // for Expression
     21#include "Type.h"            // for ArrayType, Type, Type::Qualifiers
     22
     23class Attribute;
    1924
    2025
  • src/SynTree/AttrType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Type.h"
    17 #include "Expression.h"
    18 #include "Common/utility.h"
     16#include <list>              // for list
     17#include <ostream>           // for operator<<, ostream, basic_ostream
     18#include <string>            // for char_traits, operator<<, string
     19
     20#include "Common/utility.h"  // for maybeClone
     21#include "Expression.h"      // for Expression
     22#include "Type.h"            // for AttrType, Type, Type::Qualifiers
     23
     24class Attribute;
    1925
    2026
  • src/SynTree/Attribute.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <cassert>
     16#include <ostream>           // for operator<<, ostream, basic_ostream, endl
    1717
    18 #include "Common/utility.h"
    1918#include "Attribute.h"
    20 #include "Expression.h"
     19#include "Common/utility.h"  // for cloneAll, deleteAll, printAll
     20#include "Expression.h"      // for Expression
    2121
    2222Attribute::Attribute( const Attribute &other ) : name( other.name ) {
  • src/SynTree/Attribute.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include "SynTree.h"
     18#include <iosfwd>  // for ostream
     19#include <list>    // for list
     20#include <string>  // for string, operator==
     21
     22class Expression;
    1923
    2024// GCC attribute
  • src/SynTree/BaseSyntaxNode.h

    rfc56cdbf r8135d4c  
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Feb 14 07:44:20 2017
    11 // Last Modified By :
    12 // Last Modified On :
    13 // Update Count     :
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 17 13:44:00
     13// Update Count     : 1
    1414//
    1515
    1616#pragma once
    1717
    18 #include "Common/utility.h"
    19 #include "Visitor.h"
     18#include "Common/CodeLocation.h"
     19class Visitor;
    2020
    2121class BaseSyntaxNode {
  • src/SynTree/BasicType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <cassert>
    17 #include "Type.h"
     16#include <cassert>  // for assert
     17#include <list>     // for list
     18#include <ostream>  // for operator<<, ostream
     19
     20#include "Type.h"   // for BasicType, Type, BasicType::Kind, BasicType::Kind...
     21
     22class Attribute;
    1823
    1924BasicType::BasicType( const Type::Qualifiers &tq, Kind bt, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), kind( bt ) {}
  • src/SynTree/CommaExpr.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Expression.h"
    17 #include "Type.h"
    18 #include "Common/utility.h"
     16#include <ostream>           // for ostream, endl, operator<<, basic_ostream
     17#include <string>            // for operator<<, string
     18
     19#include "Common/utility.h"  // for maybeClone
     20#include "Expression.h"      // for CommaExpr, Expression
     21#include "Type.h"            // for Type
    1922
    2023CommaExpr::CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname )
  • src/SynTree/CompoundStmt.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Statement.h"
    17 #include "Common/utility.h"
    18 #include <algorithm>
    19 #include <functional>
    20 #include "Expression.h"
    21 #include "Declaration.h"
    22 #include "SynTree/VarExprReplacer.h"
     16#include <cassert>                    // for assert, safe_dynamic_cast
     17#include <list>                       // for list, _List_const_iterator, lis...
     18#include <ostream>                    // for operator<<, ostream, basic_ostream
     19#include <string>                     // for operator==, string
     20
     21#include "Common/utility.h"           // for cloneAll, deleteAll, printAll
     22#include "Declaration.h"              // for DeclarationWithType, Declaration
     23#include "Statement.h"                // for CompoundStmt, Statement, DeclStmt
     24#include "SynTree/Label.h"            // for Label
     25#include "SynTree/VarExprReplacer.h"  // for VarExprReplacer, VarExprReplace...
    2326
    2427using std::string;
  • src/SynTree/Constant.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <iostream>
    17 #include <list>
    18 #include <string>
     16#include <cassert>   // for safe_dynamic_cast, assertf
     17#include <iostream>  // for operator<<, ostream, basic_ostream
     18#include <string>    // for to_string, string, char_traits, operator<<
    1919
    2020#include "Constant.h"
    21 #include "Type.h"
     21#include "Type.h"    // for BasicType, Type, Type::Qualifiers, PointerType
    2222
    2323Constant::Constant( Type * type, std::string rep, unsigned long long val ) : type( type ), rep( rep ), val( val ) {}
  • src/SynTree/Constant.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include "SynTree.h"
    19 #include "Visitor.h"
    20 #include "Mutator.h"
     18#include <iosfwd>     // for ostream
     19#include <string>     // for string
     20
     21#include "Mutator.h"  // for Mutator
     22#include "Visitor.h"  // for Visitor
     23
     24class Type;
    2125
    2226class Constant {
  • src/SynTree/DeclStmt.cc

    rfc56cdbf r8135d4c  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // DeclStmt.cc -- 
     7// DeclStmt.cc --
    88//
    99// Author           : Richard C. Bilson
     
    1414//
    1515
    16 #include "Statement.h"
    17 #include "Declaration.h"
    18 #include "Common/utility.h"
     16#include <cassert>           // for assert
     17#include <list>              // for list
     18#include <ostream>           // for operator<<, ostream
     19
     20#include "Common/utility.h"  // for maybeClone
     21#include "Declaration.h"     // for Declaration
     22#include "Statement.h"       // for DeclStmt, Statement
     23#include "SynTree/Label.h"   // for Label
    1924
    2025DeclStmt::DeclStmt( std::list<Label> labels, Declaration *decl ) : Statement( labels ), decl( decl ) {
  • src/SynTree/Declaration.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <string>
    17 #include <map>
     16#include <map>                       // for _Rb_tree_const_iterator, map<>::...
     17#include <ostream>                   // for ostream, operator<<, basic_ostre...
     18#include <string>                    // for string
     19#include <utility>                   // for pair
     20
     21#include "Common/utility.h"          // for maybeClone
    1822#include "Declaration.h"
    19 #include "Expression.h"
    20 #include "Initializer.h"
    21 #include "Type.h"
    22 #include "Attribute.h"
    23 #include "Common/utility.h"
     23#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
     24#include "SynTree/Statement.h"       // for AsmStmt
     25#include "SynTree/SynTree.h"         // for UniqueId
     26#include "Type.h"                    // for Type, Type::StorageClasses
    2427
    2528static UniqueId lastUniqueId = 0;
  • src/SynTree/Declaration.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include <string>
    19 
    20 #include "BaseSyntaxNode.h"
    21 #include "Mutator.h"
    22 #include "Visitor.h"
    23 #include "SynTree.h"
    24 #include "Parser/LinkageSpec.h"
    25 #include "Parser/ParseNode.h"
     18#include <cassert>               // for assertf
     19#include <iosfwd>                // for ostream
     20#include <list>                  // for list
     21#include <string>                // for string, operator+, allocator, to_string
     22
     23#include "BaseSyntaxNode.h"      // for BaseSyntaxNode
     24#include "Mutator.h"             // for Mutator
     25#include "Parser/LinkageSpec.h"  // for Spec, Cforall
     26#include "Parser/ParseNode.h"    // for DeclarationNode, DeclarationNode::Ag...
     27#include "SynTree.h"             // for UniqueId
     28#include "SynTree/Type.h"        // for Type, Type::StorageClasses, Type::Fu...
     29#include "Visitor.h"             // for Visitor
     30
     31class AsmStmt;
     32class Attribute;
     33class CompoundStmt;
     34class ConstantExpr;
     35class Expression;
     36class Initializer;
     37class TypeDecl;
    2638
    2739class Declaration : public BaseSyntaxNode {
  • src/SynTree/DeclarationWithType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Declaration.h"
    17 #include "Type.h"
    18 #include "Attribute.h"
    19 #include "Common/utility.h"
     16#include <list>                  // for list
     17#include <string>                // for string
     18
     19#include "Attribute.h"           // for Attribute
     20#include "Common/utility.h"      // for cloneAll, deleteAll, maybeClone
     21#include "Declaration.h"         // for DeclarationWithType, Declaration
     22#include "Parser/LinkageSpec.h"  // for Spec
     23#include "SynTree/Expression.h"  // for ConstantExpr
     24#include "Type.h"                // for Type, Type::FuncSpecifiers, Type::St...
    2025
    2126DeclarationWithType::DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs )
  • src/SynTree/Expression.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <iostream>
    17 #include <cassert>
    18 #include <list>
    19 #include <algorithm>
    20 
    21 #include <iterator>
    22 
    23 #include "Declaration.h"
    24 #include "Expression.h"
    25 #include "Initializer.h"
    26 #include "Statement.h"
    27 #include "Type.h"
    28 #include "TypeSubstitution.h"
    29 #include "VarExprReplacer.h"
    30 
    31 #include "Common/utility.h"
    32 #include "Common/PassVisitor.h"
    33 
    34 #include "InitTweak/InitTweak.h"
     16#include "SynTree/Expression.h"
     17
     18#include <cassert>                   // for assert, assertf
     19#include <iostream>                  // for ostream, operator<<, basic_ostream
     20#include <list>                      // for list, _List_iterator, list<>::co...
     21
     22#include "Common/utility.h"          // for maybeClone, cloneAll, deleteAll
     23#include "Declaration.h"             // for ObjectDecl, DeclarationWithType
     24#include "Expression.h"              // for Expression, ImplicitCopyCtorExpr
     25#include "InitTweak/InitTweak.h"     // for getCallArg, getPointerBase
     26#include "Initializer.h"             // for Designation, Initializer
     27#include "Statement.h"               // for CompoundStmt, ExprStmt, Statement
     28#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
     29#include "SynTree/Constant.h"        // for Constant
     30#include "Type.h"                    // for Type, BasicType, Type::Qualifiers
     31#include "TypeSubstitution.h"        // for TypeSubstitution
    3532
    3633#include "GenPoly/Lvalue.h"
  • src/SynTree/Expression.h

    rfc56cdbf r8135d4c  
    1313// Update Count     : 44
    1414//
    15 
    1615#pragma once
    1716
    18 #include <map>
    19 #include <memory>
    20 
    21 #include "BaseSyntaxNode.h"
    22 #include "Constant.h"
    23 #include "Mutator.h"
    24 #include "SynTree.h"
    25 #include "Visitor.h"
    26 #include "Common/UniqueName.h"
     17#include <iosfwd>                 // for ostream
     18#include <list>                   // for list, list<>::iterator
     19#include <map>                    // for map, map<>::value_compare
     20#include <memory>                 // for allocator, unique_ptr
     21#include <string>                 // for string
     22
     23#include "BaseSyntaxNode.h"       // for BaseSyntaxNode
     24#include "Constant.h"             // for Constant
     25#include "Initializer.h"          // for Designation (ptr only), Initializer
     26#include "Mutator.h"              // for Mutator
     27#include "SynTree.h"              // for UniqueId
     28#include "Visitor.h"              // for Visitor
     29
    2730
    2831/// Expression is the root type for all expressions
     
    5760
    5861struct ParamEntry;
     62
    5963typedef std::map< UniqueId, ParamEntry > InferredParams;
    6064
  • src/SynTree/FunctionDecl.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <cassert>
     16#include <cassert>               // for assert
     17#include <list>                  // for list
     18#include <ostream>               // for operator<<, ostream, basic_ostream
     19#include <string>                // for operator<<, string, char_traits, ope...
    1720
    18 #include "Declaration.h"
    19 #include "Statement.h"
    20 #include "Type.h"
    21 #include "Attribute.h"
    22 #include "Common/utility.h"
    23 #include "InitTweak/InitTweak.h"
    24 #include "CodeGen/FixMain.h"
     21#include "Attribute.h"           // for Attribute
     22#include "CodeGen/FixMain.h"     // for FixMain
     23#include "Common/utility.h"      // for maybeClone, printAll
     24#include "Declaration.h"         // for FunctionDecl, FunctionDecl::Parent
     25#include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
     26#include "Statement.h"           // for CompoundStmt
     27#include "Type.h"                // for Type, FunctionType, Type::FuncSpecif...
    2528
    2629extern bool translation_unit_nomain;
  • src/SynTree/FunctionType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <algorithm>
     16#include <list>              // for list
     17#include <ostream>           // for operator<<, basic_ostream, ostream, endl
     18#include <string>            // for operator<<, char_traits, string
    1719
    18 #include "Type.h"
    19 #include "Declaration.h"
    20 #include "Common/utility.h"
    21 #include "Tuples/Tuples.h"
     20#include "Common/utility.h"  // for cloneAll, deleteAll, printAll
     21#include "Declaration.h"     // for DeclarationWithType
     22#include "Tuples/Tuples.h"   // for isTtype
     23#include "Type.h"            // for FunctionType, Type, Type::Qualifiers
     24
     25class Attribute;
    2226
    2327FunctionType::FunctionType( const Type::Qualifiers &tq, bool isVarArgs, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), isVarArgs( isVarArgs ) {
  • src/SynTree/Initializer.cc

    rfc56cdbf r8135d4c  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Aug  3 11:33:00 2016
    13 // Update Count     : 29
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Aug 21 09:53:15 2017
     13// Update Count     : 30
    1414//
    1515
    1616#include "Initializer.h"
    17 #include "Expression.h"
    18 #include "Statement.h"
    19 #include "Common/utility.h"
     17
     18#include <cassert>                   // for assertf
     19#include <ostream>                   // for ostream, operator<<, basic_ostream
     20#include <string>                    // for operator<<, string, char_traits
     21
     22#include "Common/utility.h"          // for maybeClone, cloneAll, deleteAll
     23#include "Expression.h"              // for Expression
     24#include "Statement.h"               // for Statement
     25#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
    2026
    2127Designation::Designation( const std::list< Expression * > & designators ) : designators( designators ) {}
     
    7480                        }
    7581                }
    76                 assertf( initializers.size() == designations.size(), "Created ListInit with mismatching initializers (%lu) and designations (%lu)", initializers.size(), designations.size() );
     82                assertf( initializers.size() == designations.size(), "Created ListInit with mismatching initializers (%zd) and designations (%zd)", initializers.size(), designations.size() );
    7783}
    7884
  • src/SynTree/Initializer.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include <cassert>
     18#include <iosfwd>            // for ostream
     19#include <list>              // for list, list<>::const_iterator, list<>::it...
    1920
    20 #include "BaseSyntaxNode.h"
    21 #include "Mutator.h"
    22 #include "SynTree.h"
    23 #include "Type.h"
    24 #include "Visitor.h"
     21#include "BaseSyntaxNode.h"  // for BaseSyntaxNode
     22#include "Mutator.h"         // for Mutator
     23#include "Visitor.h"         // for Visitor
     24
     25class Expression;
     26class Statement;
    2527
    2628// Designation: list of designator (NameExpr, VariableExpr, and ConstantExpr) expressions that specify an object being initialized.
  • src/SynTree/Mutator.cc

    rfc56cdbf r8135d4c  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jul 24 16:32:00 2017
    13 // Update Count     : 25
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 17 15:39:37 2017
     13// Update Count     : 27
    1414//
    1515
    16 #include <cassert>
     16#include <cassert>             // for assert
     17#include <list>                // for list
     18
     19#include "Declaration.h"       // for ObjectDecl, Declaration, DeclarationWi...
     20#include "Expression.h"        // for Expression, ConstantExpr, ConditionalExpr
     21#include "Initializer.h"       // for ConstructorInit, Initializer, Designation
    1722#include "Mutator.h"
    18 #include "Initializer.h"
    19 #include "Statement.h"
    20 #include "Type.h"
    21 #include "Declaration.h"
    22 #include "Expression.h"
    23 #include "Constant.h"
    24 #include "Common/utility.h"
    25 #include "TypeSubstitution.h"
     23#include "Statement.h"         // for Statement, CatchStmt, AsmStmt, ForStmt
     24#include "Type.h"              // for Type, Type::ForallList, AttrType, Arra...
     25#include "TypeSubstitution.h"  // for TypeSubstitution
     26
     27class Constant;
     28class Subrange;
    2629
    2730Mutator::Mutator() {}
     
    111114
    112115Statement *Mutator::mutate( IfStmt *ifStmt ) {
     116        mutateAll( ifStmt->get_initialization(), *this );
    113117        ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) );
    114118        ifStmt->set_thenPart( maybeMutate( ifStmt->get_thenPart(), *this ) );
  • src/SynTree/Mutator.h

    rfc56cdbf r8135d4c  
    1313// Update Count     : 16
    1414//
    15 #include <cassert>
     15#pragma once
    1616
    17 #include "SynTree.h"
    18 #include "Common/SemanticError.h"
     17#include <cassert>                 // for assert
    1918
    20 #pragma once
     19#include "Common/SemanticError.h"  // for SemanticError
     20#include "SynTree/SynTree.h"       // for AST nodes
    2121
    2222class Mutator {
  • src/SynTree/NamedTypeDecl.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Declaration.h"
    17 #include "Type.h"
    18 #include "Common/utility.h"
     16#include <list>                  // for list
     17#include <ostream>               // for operator<<, ostream, basic_ostream
     18#include <string>                // for operator<<, string, char_traits, ope...
     19
     20#include "Common/utility.h"      // for printAll, cloneAll, deleteAll, maybe...
     21#include "Declaration.h"         // for NamedTypeDecl, DeclarationWithType
     22#include "Parser/LinkageSpec.h"  // for Spec, Cforall, linkageName
     23#include "Type.h"                // for Type, Type::StorageClasses
    1924
    2025NamedTypeDecl::NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *base )
  • src/SynTree/ObjectDecl.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Declaration.h"
    17 #include "Type.h"
    18 #include "Initializer.h"
    19 #include "Expression.h"
    20 #include "Attribute.h"
    21 #include "Common/utility.h"
    22 #include "Statement.h"
     16#include <list>                  // for list
     17#include <ostream>               // for operator<<, ostream, basic_ostream
     18#include <string>                // for operator<<, string, char_traits, ope...
     19
     20#include "Attribute.h"           // for Attribute
     21#include "Common/utility.h"      // for maybeClone, printAll
     22#include "Declaration.h"         // for ObjectDecl, ObjectDecl::Parent
     23#include "Expression.h"          // for Expression
     24#include "Initializer.h"         // for Initializer
     25#include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
     26#include "Type.h"                // for Type, Type::StorageClasses, Type::Fu...
    2327
    2428ObjectDecl::ObjectDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, Type::FuncSpecifiers fs )
  • src/SynTree/PointerType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Type.h"
    17 #include "Expression.h"
    18 #include "Common/utility.h"
     16#include <list>              // for list
     17#include <ostream>           // for operator<<, ostream
     18
     19#include "Common/utility.h"  // for maybeClone
     20#include "Expression.h"      // for Expression
     21#include "Type.h"            // for PointerType, Type, Type::Qualifiers
     22
     23class Attribute;
    1924
    2025PointerType::PointerType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes )
  • src/SynTree/ReferenceToType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <string>
    17 #include <cassert>
     16#include <stddef.h>          // for NULL
     17#include <cassert>           // for assert
     18#include <list>              // for list, _List_const_iterator, list<>::cons...
     19#include <ostream>           // for operator<<, basic_ostream, ostream, endl
     20#include <string>            // for string, operator<<, char_traits, operator==
    1821
    19 #include "Type.h"
    20 #include "Declaration.h"
    21 #include "Expression.h"
    22 #include "TypeSubstitution.h"
    23 #include "Common/utility.h"
     22#include "Common/utility.h"  // for printAll, cloneAll, deleteAll
     23#include "Declaration.h"     // for StructDecl, UnionDecl, EnumDecl, Declara...
     24#include "Expression.h"      // for Expression
     25#include "Type.h"            // for TypeInstType, StructInstType, UnionInstType
     26
     27class Attribute;
    2428
    2529ReferenceToType::ReferenceToType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), name( name ), hoistType( false ) {
  • src/SynTree/Statement.cc

    rfc56cdbf r8135d4c  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jun 12 10:37:00 2017
    13 // Update Count     : 64
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 17 16:17:20 2017
     13// Update Count     : 67
    1414//
    1515
    16 #include <functional>
    17 #include <algorithm>
    18 #include <iostream>
    19 #include <list>
    20 #include <cassert>
    21 
    22 #include "Statement.h"
    23 #include "Expression.h"
    24 #include "Declaration.h"
    25 #include "Common/SemanticError.h"
     16#include "SynTree/Statement.h"
     17
     18#include <stddef.h>                // for NULL
     19#include <cassert>                 // for assert, assertf
     20#include <iostream>                // for operator<<, basic_ostream, endl
     21#include <list>                    // for list, list<>::const_iterator, _Lis...
     22#include <string>                  // for operator<<, string, char_traits
     23
     24#include "Common/SemanticError.h"  // for SemanticError
     25#include "Common/utility.h"        // for maybeClone, cloneAll, deleteAll
     26#include "Declaration.h"           // for Declaration
     27#include "Expression.h"            // for Expression, ConstantExpr
     28#include "Statement.h"             // for Statement, ForStmt, AsmStmt, Catch...
     29#include "SynTree/Label.h"         // for Label, operator<<
    2630
    2731using std::string;
    2832using std::endl;
    2933
    30 Statement::Statement( std::list<Label> _labels ) : labels( _labels ) {}
     34Statement::Statement( std::list<Label> labels ) : labels( labels ) {}
    3135
    3236void Statement::print( __attribute__((unused)) std::ostream &, __attribute__((unused)) int indent ) const {}
     
    3438Statement::~Statement() {}
    3539
    36 ExprStmt::ExprStmt( std::list<Label> _labels, Expression *_expr ) : Statement( _labels ), expr( _expr ) {}
     40ExprStmt::ExprStmt( std::list<Label> labels, Expression *expr ) : Statement( labels ), expr( expr ) {}
    3741
    3842ExprStmt::ExprStmt( const ExprStmt &other ) : Statement( other ), expr( maybeClone( other.expr ) ) {}
     
    8488const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" };
    8589
    86 BranchStmt::BranchStmt( std::list<Label> labels, Label _target, Type _type ) throw ( SemanticError ) :
    87         Statement( labels ), originalTarget( _target ), target( _target ), computedTarget( NULL ), type( _type ) {
     90BranchStmt::BranchStmt( std::list<Label> labels, Label target, Type type ) throw ( SemanticError ) :
     91        Statement( labels ), originalTarget( target ), target( target ), computedTarget( NULL ), type( type ) {
    8892        //actually this is a syntactic error signaled by the parser
    8993        if ( type == BranchStmt::Goto && target.empty() )
     
    9195}
    9296
    93 BranchStmt::BranchStmt( std::list<Label> labels, Expression *_computedTarget, Type _type ) throw ( SemanticError ) :
    94         Statement( labels ), computedTarget( _computedTarget ), type( _type ) {
     97BranchStmt::BranchStmt( std::list<Label> labels, Expression *computedTarget, Type type ) throw ( SemanticError ) :
     98        Statement( labels ), computedTarget( computedTarget ), type( type ) {
    9599        if ( type != BranchStmt::Goto || computedTarget == 0 )
    96100                throw SemanticError("Computed target not valid in branch statement");
     
    101105}
    102106
    103 ReturnStmt::ReturnStmt( std::list<Label> labels, Expression *_expr ) : Statement( labels ), expr( _expr ) {}
     107ReturnStmt::ReturnStmt( std::list<Label> labels, Expression *expr ) : Statement( labels ), expr( expr ) {}
    104108
    105109ReturnStmt::ReturnStmt( const ReturnStmt & other ) : Statement( other ), expr( maybeClone( other.expr ) ) {}
     
    118122}
    119123
    120 IfStmt::IfStmt( std::list<Label> _labels, Expression *_condition, Statement *_thenPart, Statement *_elsePart ):
    121         Statement( _labels ), condition( _condition ), thenPart( _thenPart ), elsePart( _elsePart ) {}
     124IfStmt::IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart, std::list<Statement *> initialization ):
     125        Statement( labels ), condition( condition ), thenPart( thenPart ), elsePart( elsePart ), initialization( initialization ) {}
    122126
    123127IfStmt::IfStmt( const IfStmt & other ) :
    124         Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {}
     128        Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {
     129        cloneAll( other.initialization, initialization );
     130}
    125131
    126132IfStmt::~IfStmt() {
     133        deleteAll( initialization );
    127134        delete condition;
    128135        delete thenPart;
     
    135142        condition->print( os, indent + 4 );
    136143
     144        if ( !initialization.empty() ) {
     145                os << string( indent + 2, ' ' ) << "initialization: \n";
     146                for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) {
     147                        os << string( indent + 4, ' ' );
     148                        (*it)->print( os, indent + 4 );
     149                }
     150                os << endl;
     151        }
     152
    137153        os << string( indent+2, ' ' ) << "... then: " << endl;
    138154
     
    147163}
    148164
    149 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_statements ):
    150         Statement( _labels ), condition( _condition ), statements( _statements ) {
     165SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, std::list<Statement *> &statements ):
     166        Statement( labels ), condition( condition ), statements( statements ) {
    151167}
    152168
     
    175191}
    176192
    177 CaseStmt::CaseStmt( std::list<Label> _labels, Expression *_condition, std::list<Statement *> &_statements, bool deflt ) throw ( SemanticError ) :
    178         Statement( _labels ), condition( _condition ), stmts( _statements ), _isDefault( deflt ) {
     193CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :
     194        Statement( labels ), condition( condition ), stmts( statements ), _isDefault( deflt ) {
    179195        if ( isDefault() && condition != 0 )
    180196                throw SemanticError("default with conditions");
     
    212228}
    213229
    214 WhileStmt::WhileStmt( std::list<Label> labels, Expression *condition_, Statement *body_, bool isDoWhile_ ):
    215         Statement( labels ), condition( condition_), body( body_), isDoWhile( isDoWhile_) {
     230WhileStmt::WhileStmt( std::list<Label> labels, Expression *condition, Statement *body, bool isDoWhile ):
     231        Statement( labels ), condition( condition), body( body), isDoWhile( isDoWhile) {
    216232}
    217233
     
    234250}
    235251
    236 ForStmt::ForStmt( std::list<Label> labels, std::list<Statement *> initialization_, Expression *condition_, Expression *increment_, Statement *body_ ):
    237         Statement( labels ), initialization( initialization_ ), condition( condition_ ), increment( increment_ ), body( body_ ) {
     252ForStmt::ForStmt( std::list<Label> labels, std::list<Statement *> initialization, Expression *condition, Expression *increment, Statement *body ):
     253        Statement( labels ), initialization( initialization ), condition( condition ), increment( increment ), body( body ) {
    238254}
    239255
     
    313329}
    314330
    315 TryStmt::TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &_handlers, FinallyStmt *_finallyBlock ) :
    316         Statement( labels ), block( tryBlock ),  handlers( _handlers ), finallyBlock( _finallyBlock ) {
     331TryStmt::TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock ) :
     332        Statement( labels ), block( tryBlock ),  handlers( handlers ), finallyBlock( finallyBlock ) {
    317333}
    318334
     
    329345void TryStmt::print( std::ostream &os, int indent ) const {
    330346        os << "Try Statement" << endl;
    331         os << string( indent + 2, ' ' ) << "with block: " << endl;
     347        os << string( indent + 2, ' ' ) << "with block:" << endl;
     348        os << string( indent + 4, ' ' );
    332349        block->print( os, indent + 4 );
    333350
    334351        // handlers
    335         os << string( indent + 2, ' ' ) << "and handlers: " << endl;
    336         for ( std::list<CatchStmt *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
     352        os << string( indent + 2, ' ' ) << "and handlers:" << endl;
     353        for ( std::list<CatchStmt *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) {
     354                os << string( indent + 4, ' ' );
    337355                (*i )->print( os, indent + 4 );
     356        }
    338357
    339358        // finally block
    340359        if ( finallyBlock != 0 ) {
    341                 os << string( indent + 2, ' ' ) << "Finally block: " << endl;
     360                os << string( indent + 2, ' ' ) << "and finally:" << endl;
    342361                finallyBlock->print( os, indent + 4 );
    343362        } // if
    344363}
    345364
    346 CatchStmt::CatchStmt( std::list<Label> labels, Kind _kind, Declaration *_decl, Expression *_cond, Statement *_body ) :
    347         Statement( labels ), kind ( _kind ), decl ( _decl ), cond ( _cond ), body( _body ) {
     365CatchStmt::CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl, Expression *cond, Statement *body ) :
     366        Statement( labels ), kind ( kind ), decl ( decl ), cond ( cond ), body( body ) {
    348367}
    349368
     
    360379        os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl;
    361380
    362         os << string( indent, ' ' ) << "... catching" << endl;
     381        os << string( indent + 2, ' ' ) << "... catching: ";
    363382        if ( decl ) {
    364383                decl->printShort( os, indent + 4 );
     
    367386        else
    368387                os << string( indent + 4 , ' ' ) << ">>> Error:  this catch clause must have a declaration <<<" << endl;
    369 }
    370 
    371 
    372 FinallyStmt::FinallyStmt( std::list<Label> labels, CompoundStmt *_block ) : Statement( labels ), block( _block ) {
     388
     389        if ( cond ) {
     390                os << string( indent + 2, ' ' ) << "with conditional:" << endl;
     391                os << string( indent + 4, ' ' );
     392                cond->print( os, indent + 4 );
     393        }
     394        else
     395                os << string( indent + 2, ' ' ) << "with no conditional" << endl;
     396
     397        os << string( indent + 2, ' ' ) << "with block:" << endl;
     398        os << string( indent + 4, ' ' );
     399        body->print( os, indent + 4 );
     400}
     401
     402
     403FinallyStmt::FinallyStmt( std::list<Label> labels, CompoundStmt *block ) : Statement( labels ), block( block ) {
    373404        assert( labels.empty() ); // finally statement cannot be labeled
    374405}
     
    383414void FinallyStmt::print( std::ostream &os, int indent ) const {
    384415        os << "Finally Statement" << endl;
    385         os << string( indent + 2, ' ' ) << "with block: " << endl;
     416        os << string( indent + 2, ' ' ) << "with block:" << endl;
     417        os << string( indent + 4, ' ' );
    386418        block->print( os, indent + 4 );
    387419}
  • src/SynTree/Statement.h

    rfc56cdbf r8135d4c  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Aug  3 14:08:00 2017
    13 // Update Count     : 69
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 17 15:37:53 2017
     13// Update Count     : 72
    1414//
    1515
    1616#pragma once
    1717
    18 #include "BaseSyntaxNode.h"
    19 #include "Label.h"
    20 #include "Mutator.h"
    21 #include "SynTree.h"
    22 #include "Type.h"
    23 #include "Visitor.h"
    24 #include "Common/SemanticError.h"
     18#include <iosfwd>                  // for ostream
     19#include <list>                    // for list
     20#include <memory>                  // for allocator
     21
     22#include "BaseSyntaxNode.h"        // for BaseSyntaxNode
     23#include "Common/SemanticError.h"  // for SemanticError
     24#include "Label.h"                 // for Label
     25#include "Mutator.h"               // for Mutator
     26#include "Visitor.h"               // for Visitor
     27
     28class CatchStmt;
     29class ConstantExpr;
     30class Declaration;
     31class Expression;
     32class FinallyStmt;
    2533
    2634class Statement : public BaseSyntaxNode {
     
    122130        Statement *thenPart;
    123131        Statement *elsePart;
    124 
    125         IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart );
     132        std::list<Statement *> initialization;
     133
     134        IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart,
     135                        std::list<Statement *> initialization = std::list<Statement *>() );
    126136        IfStmt( const IfStmt &other );
    127137        virtual ~IfStmt();
    128138
     139        std::list<Statement *> &get_initialization() { return initialization; }
    129140        Expression *get_condition() { return condition; }
    130141        void set_condition( Expression *newValue ) { condition = newValue; }
     
    228239
    229240        std::list<Statement *> &get_initialization() { return initialization; }
    230         void set_initialization( std::list<Statement *> newValue ) { initialization = newValue; }
    231241        Expression *get_condition() { return condition; }
    232242        void set_condition( Expression *newValue ) { condition = newValue; }
  • src/SynTree/TupleExpr.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Expression.h"
    17 #include "Common/utility.h"
    18 #include "Type.h"
    19 #include "Declaration.h"
    20 #include "Tuples/Tuples.h"
    21 #include "VarExprReplacer.h"
     16#include <cassert>              // for assert, safe_dynamic_cast, assertf
     17#include <iterator>             // for next
     18#include <list>                 // for list, _List_iterator
     19#include <ostream>              // for ostream, operator<<, basic_ostream, endl
     20#include <string>               // for operator<<, string, char_traits
     21
     22#include "Common/utility.h"     // for cloneAll, deleteAll, printAll, toString
     23#include "Declaration.h"        // for ObjectDecl
     24#include "Expression.h"         // for Expression, TupleExpr, TupleIndexExpr
     25#include "SynTree/Label.h"      // for Label, noLabels
     26#include "SynTree/Statement.h"  // for CompoundStmt, DeclStmt, ExprStmt, Sta...
     27#include "Tuples/Tuples.h"      // for makeTupleType
     28#include "Type.h"               // for TupleType, Type
    2229
    2330UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname ) : Expression( _aname ), exprs( exprs ) {
  • src/SynTree/TupleType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Declaration.h"
    17 #include "Initializer.h"
    18 #include "Type.h"
    19 #include "Common/utility.h"
    20 #include "Parser/LinkageSpec.h"
     16#include <list>                  // for list
     17#include <ostream>               // for operator<<, ostream, basic_ostream
     18
     19#include "Common/utility.h"      // for cloneAll, deleteAll, printAll
     20#include "Declaration.h"         // for Declaration, ObjectDecl
     21#include "Initializer.h"         // for ListInit
     22#include "Parser/LinkageSpec.h"  // for Cforall
     23#include "Type.h"                // for TupleType, Type, Type::Qualifiers
     24
     25class Attribute;
    2126
    2227TupleType::TupleType( const Type::Qualifiers &tq, const std::list< Type * > & types, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), types( types ) {
  • src/SynTree/Type.cc

    rfc56cdbf r8135d4c  
    1313// Update Count     : 29
    1414//
     15#include "Type.h"
    1516
    16 #include "SynTree.h"
    17 #include "Visitor.h"
    18 #include "Type.h"
    19 #include "Declaration.h"
    20 #include "Attribute.h"
    21 #include "InitTweak/InitTweak.h"
    22 #include "Common/utility.h"
     17#include "Attribute.h"               // for Attribute
     18#include "Common/utility.h"          // for cloneAll, deleteAll, printAll
     19#include "InitTweak/InitTweak.h"     // for getPointerBase
     20#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
     21#include "SynTree/Declaration.h"     // for TypeDecl
    2322
    2423using namespace std;
  • src/SynTree/Type.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include "BaseSyntaxNode.h"
    19 #include "Mutator.h"
    20 #include "SynTree.h"
    21 #include "Visitor.h"
    22 #include <strings.h>                                                                    // ffs
     18#include <strings.h>         // for ffs
     19#include <cassert>           // for assert, assertf
     20#include <list>              // for list, _List_iterator
     21#include <ostream>           // for ostream, operator<<, basic_ostream
     22#include <string>            // for string
     23
     24#include "BaseSyntaxNode.h"  // for BaseSyntaxNode
     25#include "Common/utility.h"  // for operator+
     26#include "Mutator.h"         // for Mutator
     27#include "SynTree.h"         // for AST nodes
     28#include "Visitor.h"         // for Visitor
    2329
    2430class Type : public BaseSyntaxNode {
  • src/SynTree/TypeDecl.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Declaration.h"
    17 #include "Type.h"
    18 #include "Common/utility.h"
     16#include <ostream>           // for ostream, operator<<, basic_ostream, basi...
     17#include <string>            // for string, char_traits, operator+, operator<<
     18
     19#include "Common/utility.h"  // for maybeClone
     20#include "Declaration.h"     // for TypeDecl, TypeDecl::Data, TypeDecl::Kind...
     21#include "Type.h"            // for Type, Type::StorageClasses
    1922
    2023TypeDecl::TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init ) : Parent( name, scs, type ), init( init ), sized( kind == Any || kind == Ttype ), kind( kind ) {
  • src/SynTree/TypeExpr.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Expression.h"
    17 #include "Type.h"
    18 #include "Common/utility.h"
     16#include <iosfwd>            // for ostream
     17
     18#include "Common/utility.h"  // for maybeClone
     19#include "Expression.h"      // for TypeExpr, Expression
     20#include "Type.h"            // for Type
    1921
    2022TypeExpr::TypeExpr( Type *type ) : type( type ) {
  • src/SynTree/TypeSubstitution.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Type.h"
     16#include <ostream>  // for ostream, basic_ostream, operator<<, endl
     17
     18#include "Type.h"   // for TypeInstType, Type, StructInstType, UnionInstType
    1719#include "TypeSubstitution.h"
    1820
  • src/SynTree/TypeSubstitution.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include <map>
    19 #include <set>
    20 #include <cassert>
     18#include <cassert>                 // for assert
     19#include <iosfwd>                  // for ostream
     20#include <list>                    // for list<>::iterator, _List_iterator
     21#include <map>                     // for _Rb_tree_iterator, map, map<>::val...
     22#include <set>                     // for set
     23#include <string>                  // for string, operator!=
     24#include <utility>                 // for pair
    2125
    22 #include "SynTree/Mutator.h"
    23 #include "SynTree/Declaration.h"
    24 #include "SynTree/Expression.h"
     26#include "Common/SemanticError.h"  // for SemanticError
     27#include "SynTree/Declaration.h"   // for TypeDecl, Declaration (ptr only)
     28#include "SynTree/Expression.h"    // for Expression (ptr only), NameExpr (p...
     29#include "SynTree/Mutator.h"       // for Mutator
     30#include "SynTree/Type.h"          // for Type, ArrayType (ptr only), BasicT...
    2531
    2632class TypeSubstitution : public Mutator {
  • src/SynTree/TypeofType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Type.h"
    17 #include "Expression.h"
    18 #include "Common/utility.h"
     16#include <list>              // for list
     17#include <ostream>           // for operator<<, ostream
     18
     19#include "Common/utility.h"  // for maybeClone
     20#include "Expression.h"      // for Expression
     21#include "Type.h"            // for TypeofType, Type, Type::Qualifiers
     22
     23class Attribute;
    1924
    2025TypeofType::TypeofType( const Type::Qualifiers &tq, Expression *expr, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), expr( expr ) {
  • src/SynTree/VarArgsType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Type.h"
     16#include <list>     // for list
     17#include <ostream>  // for operator<<, ostream
     18
     19#include "Type.h"   // for Type, VarArgsType, Type::Qualifiers
     20
     21class Attribute;
    1722
    1823VarArgsType::VarArgsType() : Type( Type::Qualifiers(), std::list< Attribute * >() ) {}
  • src/SynTree/VarExprReplacer.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Declaration.h"
    17 #include "Expression.h"
     16#include <iostream>       // for operator<<, basic_ostream, ostream, basic_o...
     17
     18#include "Declaration.h"  // for operator<<, DeclarationWithType
     19#include "Expression.h"   // for VariableExpr
    1820#include "VarExprReplacer.h"
    1921
  • src/SynTree/VarExprReplacer.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include <map>
     18#include <map>                // for map, map<>::value_compare
    1919
    20 #include "SynTree/SynTree.h"
     20#include "SynTree/Visitor.h"  // for Visitor
     21
     22class DeclarationWithType;
     23class VariableExpr;
    2124
    2225/// Visitor that replaces the declarations that VariableExprs refer to, according to the supplied mapping
  • src/SynTree/Visitor.cc

    rfc56cdbf r8135d4c  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jul 24 16:30:00 2017
    13 // Update Count     : 27
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 17 15:39:38 2017
     13// Update Count     : 29
    1414//
    1515
    16 #include <cassert>
     16#include <cassert>        // for assert
     17#include <list>           // for list
     18
     19#include "Constant.h"     // for Constant
     20#include "Declaration.h"  // for DeclarationWithType, ObjectDecl, Declaration
     21#include "Expression.h"   // for Expression, ConstantExpr, ImplicitCopyCtorExpr
     22#include "Initializer.h"  // for Initializer, Designation, ConstructorInit
     23#include "Statement.h"    // for Statement, CatchStmt, AsmStmt, CompoundStmt
     24#include "Type.h"         // for Type, Type::ForallList, AttrType, FunctionType
    1725#include "Visitor.h"
    18 #include "Initializer.h"
    19 #include "Statement.h"
    20 #include "Type.h"
    21 #include "Declaration.h"
    22 #include "Expression.h"
    23 #include "Constant.h"
     26
     27class Subrange;
    2428
    2529Visitor::Visitor() {}
     
    9599
    96100void Visitor::visit( IfStmt *ifStmt ) {
     101        acceptAll( ifStmt->get_initialization(), *this );
    97102        maybeAccept( ifStmt->get_condition(), *this );
    98103        maybeAccept( ifStmt->get_thenPart(), *this );
  • src/SynTree/Visitor.h

    rfc56cdbf r8135d4c  
    1616#pragma once
    1717
    18 #include "SynTree.h"
    19 #include "Common/SemanticError.h"
    20 #include "Common/CompilerError.h"
     18#include "Common/SemanticError.h"  // for SemanticError
     19#include "SynTree.h"               // for AST nodes
    2120
    2221class Visitor {
  • src/SynTree/VoidType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Type.h"
     16#include <list>     // for list
     17#include <ostream>  // for operator<<, ostream
     18
     19#include "Type.h"   // for VoidType, Type, Type::Qualifiers
     20
     21class Attribute;
    1722
    1823VoidType::VoidType( const Type::Qualifiers &tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {
  • src/SynTree/ZeroOneType.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include "Type.h"
     16#include <list>     // for list
     17#include <ostream>  // for operator<<, ostream
     18
     19#include "Type.h"   // for Type, Type::Qualifiers, OneType, ZeroType
     20
     21class Attribute;
    1722
    1823ZeroType::ZeroType() : Type( Type::Qualifiers(), std::list< Attribute * >() ) {}
Note: See TracChangeset for help on using the changeset viewer.