Changes in / [6ac5223:97e3296]


Ignore:
Files:
4 deleted
151 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.h

    r6ac5223 r97e3296  
    2020#include <string>                 // for string
    2121
    22 #include "Common/Indenter.h"      // for Indenter
    2322#include "SynTree/Declaration.h"  // for DeclarationWithType (ptr only), Fun...
    2423#include "SynTree/Visitor.h"      // for Visitor
    2524#include "SynTree/SynTree.h"      // for Visitor Nodes
     25
     26#include "Common/Indenter.h"      // for Indenter
    2627
    2728namespace CodeGen {
  • src/CodeTools/TrackLoc.cc

    r6ac5223 r97e3296  
    1818#include <cstdlib>                   // for exit, EXIT_FAILURE
    1919#include <iostream>                  // for operator<<, ostream, basic_ostream
    20 #include <iterator>                  // for back_inserter, inserter
    2120#include <stack>                     // for stack
    2221#include <string>                    // for operator<<, string
     
    2423
    2524#include "Common/PassVisitor.h"      // for PassVisitor
    26 #include "Common/SemanticError.h"    // for SemanticError
    2725#include "Common/utility.h"          // for CodeLocation
    2826#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
    29 #include "SynTree/Mutator.h"         // for mutateAll
    30 #include "SynTree/Visitor.h"         // for acceptAll
    3127
    3228class Declaration;
  • src/Common/PassVisitor.h

    r6ac5223 r97e3296  
    11#pragma once
    2 
    3 // IWYU pragma: private, include "Common/PassVisitor.h"
    42
    53#include <stack>
  • src/Common/SemanticError.h

    r6ac5223 r97e3296  
    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 17 14:01:00 2017
    13 // Update Count     : 7
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Jul 21 22:18:59 2017
     13// Update Count     : 6
    1414//
    1515
     
    2121#include <string>     // for string
    2222
    23 #include "CodeLocation.h"  // for CodeLocation, toString
     23#include "utility.h"  // for CodeLocation, toString
    2424
    2525struct error {
  • src/Common/utility.h

    r6ac5223 r97e3296  
    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 17 11:38:00 2017
    13 // Update Count     : 34
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Jul 21 22:19:13 2017
     13// Update Count     : 33
    1414//
    1515
     
    2727
    2828#include <cassert>
    29 
    3029template< typename T >
    3130static inline T * maybeClone( const T *orig ) {
     
    341340}
    342341
     342struct CodeLocation {
     343        int linenumber;
     344        std::string filename;
     345
     346        /// Create a new unset CodeLocation.
     347        CodeLocation()
     348                : linenumber( -1 )
     349                , filename("")
     350        {}
     351
     352        /// Create a new CodeLocation with the given values.
     353        CodeLocation( const char* filename, int lineno )
     354                : linenumber( lineno )
     355                , filename(filename ? filename : "")
     356        {}
     357
     358        CodeLocation( const CodeLocation& rhs ) = default;
     359
     360        bool isSet () const {
     361                return -1 != linenumber;
     362        }
     363
     364        bool isUnset () const {
     365                return !isSet();
     366        }
     367
     368        void unset () {
     369                linenumber = -1;
     370                filename = "";
     371        }
     372
     373        // Use field access for set.
     374};
     375
     376inline std::string to_string( const CodeLocation& location ) {
     377        return location.isSet() ? location.filename + ":" + std::to_string(location.linenumber) + " " : "";
     378}
     379
    343380// Local Variables: //
    344381// tab-width: 4 //
  • src/ControlStruct/ExceptTranslate.cc

    r6ac5223 r97e3296  
    1515
    1616#include "ExceptTranslate.h"
    17 
    18 #include <stddef.h>                   // for NULL
    19 #include <cassert>                    // for assert, assertf
    20 #include <iterator>                   // for back_inserter, inserter
    21 #include <string>                     // for string, operator==
    22 
    23 #include "Common/PassVisitor.h"       // for PassVisitor, WithGuards
    24 #include "Common/SemanticError.h"     // for SemanticError
    25 #include "Common/utility.h"           // for CodeLocation
    26 #include "Parser/LinkageSpec.h"       // for Cforall
    27 #include "SynTree/Attribute.h"        // for Attribute
    28 #include "SynTree/Constant.h"         // for Constant
    29 #include "SynTree/Declaration.h"      // for ObjectDecl, FunctionDecl, Struc...
    30 #include "SynTree/Expression.h"       // for UntypedExpr, ConstantExpr, Name...
    31 #include "SynTree/Initializer.h"      // for SingleInit, ListInit
    32 #include "SynTree/Label.h"            // for Label, noLabels
    33 #include "SynTree/Mutator.h"          // for mutateAll
    34 #include "SynTree/Statement.h"        // for CompoundStmt, CatchStmt, ThrowStmt
    35 #include "SynTree/Type.h"             // for FunctionType, Type, noQualifiers
    36 #include "SynTree/VarExprReplacer.h"  // for VarExprReplacer, VarExprReplace...
    37 #include "SynTree/Visitor.h"          // for acceptAll
     17#include "Common/PassVisitor.h"
     18#include "SynTree/Statement.h"
     19#include "SynTree/Declaration.h"
     20#include "SynTree/Expression.h"
     21#include "SynTree/Type.h"
     22#include "SynTree/Attribute.h"
     23#include "SynTree/VarExprReplacer.h"
    3824
    3925namespace ControlStruct {
  • src/ControlStruct/ExceptTranslate.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>  // for list
    19 
    20 class Declaration;
     18#include <list>
     19#include "SynTree/SynTree.h"
    2120
    2221namespace ControlStruct {
  • src/ControlStruct/ForExprMutator.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <list>                 // for list, _List_iterator, list<>::iterator
    17 
     16#include "SynTree/Mutator.h"
     17#include "SynTree/Statement.h"
    1818#include "ForExprMutator.h"
    19 #include "SynTree/Label.h"      // for Label
    20 #include "SynTree/Statement.h"  // for Statement (ptr only), ForStmt, Compou...
    2119
    2220namespace ControlStruct {
  • src/ControlStruct/ForExprMutator.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 class ForStmt;
    19 class Statement;
     18#include "SynTree/Mutator.h"
     19#include "Common/utility.h"
    2020
    2121namespace ControlStruct {
  • src/ControlStruct/LabelFixer.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                         // for assert
    17 #include <list>                            // for list, _List_iterator, list...
    18 #include <string>                          // for operator+, string, operator==
    19 #include <utility>                         // for pair
     16#include <list>
     17#include <cassert>
    2018
    21 #include "ControlStruct/LabelGenerator.h"  // for LabelGenerator
    2219#include "LabelFixer.h"
    23 #include "MLEMutator.h"                    // for MLEMutator
    24 #include "SynTree/Declaration.h"           // for FunctionDecl
    25 #include "SynTree/Expression.h"            // for NameExpr, Expression, Unty...
    26 #include "SynTree/Statement.h"             // for Statement, BranchStmt, Com...
     20#include "MLEMutator.h"
     21#include "SynTree/Expression.h"
     22#include "SynTree/Statement.h"
     23#include "SynTree/Declaration.h"
     24#include "Common/utility.h"
     25
     26#include <iostream>
    2727
    2828namespace ControlStruct {
  • src/ControlStruct/LabelFixer.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>                    // for list
    19 #include <map>                     // for map
    20 
    21 #include "Common/SemanticError.h"  // for SemanticError
    22 #include "SynTree/Label.h"         // for Label
    23 #include "SynTree/Visitor.h"       // for Visitor
    24 #include "SynTree/SynTree.h"       // for Visitor Nodes
     18#include "Common/utility.h"
     19#include "SynTree/SynTree.h"
     20#include "SynTree/Visitor.h"
     21#include "SynTree/Label.h"
     22#include "LabelGenerator.h"
     23#include <map>
    2524
    2625namespace ControlStruct {
    2726        /// normalizes label definitions and generates multi-level exit labels
    28 class LabelGenerator;
    29 
    3027        class LabelFixer final : public Visitor {
    3128                typedef Visitor Parent;
  • src/ControlStruct/LabelGenerator.cc

    r6ac5223 r97e3296  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Aug 14 14:14:00 2015
    13 // Update Count     : 14
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Jun 23 12:18:34 2015
     13// Update Count     : 13
    1414//
    1515
    16 #include <iostream>             // for operator<<, basic_ostream
    17 #include <sstream>              // for ostringstream
    18 #include <list>                 // for list
     16#include <iostream>
     17#include <sstream>
    1918
    2019#include "LabelGenerator.h"
    21 #include "SynTree/Attribute.h"  // for Attribute
    22 #include "SynTree/Label.h"      // for Label, operator<<
    23 #include "SynTree/Statement.h"  // for Statement
     20#include "SynTree/Label.h"
     21#include "SynTree/Attribute.h"
     22#include "SynTree/Statement.h"
    2423
    2524namespace ControlStruct {
  • src/ControlStruct/LabelGenerator.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <string>           // for string
    19 
    20 #include "SynTree/Label.h"  // for Label
    21 
    22 class Statement;
     18#include "SynTree/SynTree.h"
     19#include <string>
    2320
    2421namespace ControlStruct {
  • src/ControlStruct/MLEMutator.cc

    r6ac5223 r97e3296  
    2020// where these labels are generated.
    2121
    22 #include <ext/alloc_traits.h>              // for __alloc_traits<>::value_type
    23 #include <algorithm>                       // for find, find_if
    24 #include <cassert>                         // for assert, assertf
    25 #include <memory>                          // for allocator_traits<>::value_...
    26 
    27 #include "Common/utility.h"                // for toString, operator+
    28 #include "ControlStruct/LabelGenerator.h"  // for LabelGenerator
     22#include <cassert>
     23#include <algorithm>
     24
    2925#include "MLEMutator.h"
    30 #include "SynTree/Attribute.h"             // for Attribute
    31 #include "SynTree/Expression.h"            // for Expression
    32 #include "SynTree/Statement.h"             // for BranchStmt, CompoundStmt
     26#include "SynTree/Statement.h"
     27#include "SynTree/Expression.h"
     28#include "SynTree/Attribute.h"
    3329
    3430namespace ControlStruct {
  • src/ControlStruct/MLEMutator.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>                    // for list
    19 #include <map>                     // for map
    20 #include <string>                  // for string
     18#include <map>
     19#include <list>
    2120
    22 #include "Common/SemanticError.h"  // for SemanticError
    23 #include "SynTree/Label.h"         // for Label
    24 #include "SynTree/Mutator.h"       // for Mutator
    25 #include "SynTree/SynTree.h"       // for Visitor Nodes
     21#include "Common/utility.h"
     22#include "SynTree/SynTree.h"
     23#include "SynTree/Mutator.h"
     24#include "SynTree/Label.h"
     25
     26#include "LabelGenerator.h"
    2627
    2728namespace ControlStruct {
    28 class LabelGenerator;
    29 
    3029        class MLEMutator : public Mutator {
    3130                class Entry;
    32 
    3331                typedef Mutator Parent;
    3432          public:
  • src/ControlStruct/Mutate.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <iterator>                // for back_inserter, inserter
    17 #include <list>                    // for list
     16#include <algorithm>
     17#include <iostream>
     18#include <cassert>
     19#include <list>
    1820
    19 #include "Common/PassVisitor.h"    // for mutateAll
    20 #include "Common/SemanticError.h"  // for SemanticError
    21 #include "ForExprMutator.h"        // for ForExprMutator
    22 #include "LabelFixer.h"            // for LabelFixer
    2321#include "Mutate.h"
    24 #include "SynTree/Declaration.h"   // for Declaration
    25 #include "SynTree/Mutator.h"       // for mutateAll
     22#include "LabelFixer.h"
     23#include "MLEMutator.h"
     24#include "ForExprMutator.h"
    2625//#include "ExceptMutator.h"
    2726
    28 #include "Common/PassVisitor.h"    // for PassVisitor
    29 #include "SynTree/Visitor.h"       // for acceptAll
     27#include "Common/utility.h"
     28#include "Common/PassVisitor.h"
     29
     30#include "SynTree/Visitor.h"
    3031
    3132using namespace std;
  • src/ControlStruct/Mutate.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>  // for list
     18#include <list>
     19#include <iostream>
    1920
    20 class Declaration;
     21#include "SynTree/Declaration.h"
    2122
    2223namespace ControlStruct {
  • src/GenPoly/Box.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <algorithm>                     // for mismatch
    17 #include <cassert>                       // for assert, safe_dynamic_cast
    18 #include <iostream>                      // for operator<<, stringstream
    19 #include <list>                          // for list, list<>::iterator, _Lis...
    20 #include <map>                           // for _Rb_tree_const_iterator, map
    21 #include <memory>                        // for auto_ptr
    22 #include <set>                           // for set
    23 #include <string>                        // for string, allocator, basic_string
    24 #include <utility>                       // for pair
     16#include <algorithm>
     17#include <iterator>
     18#include <list>
     19#include <map>
     20#include <set>
     21#include <stack>
     22#include <string>
     23#include <utility>
     24#include <vector>
     25#include <cassert>
    2526
    2627#include "Box.h"
    27 #include "Common/ScopedMap.h"            // for ScopedMap, ScopedMap<>::iter...
    28 #include "Common/SemanticError.h"        // for SemanticError
    29 #include "Common/UniqueName.h"           // for UniqueName
    30 #include "Common/utility.h"              // for toString
    31 #include "DeclMutator.h"                 // for DeclMutator
    32 #include "FindFunction.h"                // for findFunction, findAndReplace...
    33 #include "GenPoly/ErasableScopedMap.h"   // for ErasableScopedMap<>::const_i...
    34 #include "GenPoly/GenPoly.h"             // for TyVarMap, isPolyType, mangle...
    35 #include "InitTweak/InitTweak.h"         // for getFunctionName, isAssignment
    36 #include "Lvalue.h"                      // for generalizedLvalue
    37 #include "Parser/LinkageSpec.h"          // for C, Spec, Cforall, Intrinsic
    38 #include "PolyMutator.h"                 // for PolyMutator
    39 #include "ResolvExpr/TypeEnvironment.h"  // for EqvClass
    40 #include "ResolvExpr/typeops.h"          // for typesCompatible
    41 #include "ScopedSet.h"                   // for ScopedSet, ScopedSet<>::iter...
    42 #include "ScrubTyVars.h"                 // for ScrubTyVars
    43 #include "SymTab/Indexer.h"              // for Indexer
    44 #include "SymTab/Mangler.h"              // for Mangler
    45 #include "SynTree/Attribute.h"           // for Attribute
    46 #include "SynTree/Constant.h"            // for Constant
    47 #include "SynTree/Declaration.h"         // for DeclarationWithType, ObjectDecl
    48 #include "SynTree/Expression.h"          // for ApplicationExpr, UntypedExpr
    49 #include "SynTree/Initializer.h"         // for SingleInit, Initializer, Lis...
    50 #include "SynTree/Label.h"               // for Label, noLabels
    51 #include "SynTree/Mutator.h"             // for maybeMutate, Mutator, mutateAll
    52 #include "SynTree/Statement.h"           // for ExprStmt, DeclStmt, ReturnStmt
    53 #include "SynTree/SynTree.h"             // for UniqueId
    54 #include "SynTree/Type.h"                // for Type, FunctionType, PointerType
    55 #include "SynTree/TypeSubstitution.h"    // for TypeSubstitution, operator<<
     28#include "DeclMutator.h"
     29#include "Lvalue.h"
     30#include "FindFunction.h"
     31#include "PolyMutator.h"
     32#include "ScopedSet.h"
     33#include "ScrubTyVars.h"
     34
     35#include "Parser/ParseNode.h"
     36
     37#include "SynTree/Attribute.h"
     38#include "SynTree/Constant.h"
     39#include "SynTree/Declaration.h"
     40#include "SynTree/Expression.h"
     41#include "SynTree/Initializer.h"
     42#include "SynTree/Mutator.h"
     43#include "SynTree/Statement.h"
     44#include "SynTree/Type.h"
     45#include "SynTree/TypeSubstitution.h"
     46
     47#include "ResolvExpr/TypeEnvironment.h"
     48#include "ResolvExpr/TypeMap.h"
     49#include "ResolvExpr/typeops.h"
     50
     51#include "SymTab/Indexer.h"
     52#include "SymTab/Mangler.h"
     53
     54#include "Common/ScopedMap.h"
     55#include "Common/SemanticError.h"
     56#include "Common/UniqueName.h"
     57#include "Common/utility.h"
     58
     59#include "InitTweak/InitTweak.h"
     60
     61#include <ext/functional> // temporary
    5662
    5763namespace GenPoly {
  • src/GenPoly/Box.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>  // for list
    19 
    20 class Declaration;
     18#include <list>
     19#include "SynTree/SynTree.h"
    2120
    2221namespace GenPoly {
  • src/GenPoly/CopyParams.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                 // for assert
    17 #include <list>                    // for list, _List_iterator, _List_const_...
    18 #include <map>                     // for map, _Rb_tree_const_iterator, map<...
    19 #include <set>                     // for set, set<>::const_iterator
    20 #include <string>                  // for string, operator==
    21 #include <utility>                 // for pair
     16#include <set>
     17#include <map>
     18#include <cassert>
    2219
    23 #include "Common/SemanticError.h"  // for SemanticError
    24 #include "Common/UniqueName.h"     // for UniqueName
    25 #include "SynTree/Declaration.h"   // for DeclarationWithType, TypeDecl, Fun...
    26 #include "SynTree/Expression.h"    // for VariableExpr, ApplicationExpr, Add...
    27 #include "SynTree/Label.h"         // for Label, noLabels
    28 #include "SynTree/Statement.h"     // for CompoundStmt, DeclStmt, ExprStmt
    29 #include "SynTree/SynTree.h"       // for UniqueId
    30 #include "SynTree/Type.h"          // for FunctionType, TypeInstType, Type
    31 #include "SynTree/Visitor.h"       // for acceptAll, Visitor
     20#include "SynTree/Declaration.h"
     21#include "SynTree/Type.h"
     22#include "SynTree/Expression.h"
     23#include "SynTree/Statement.h"
     24#include "SynTree/Visitor.h"
     25#include "Common/UniqueName.h"
    3226
    3327namespace GenPoly {
  • src/GenPoly/DeclMutator.cc

    r6ac5223 r97e3296  
    1616#include "DeclMutator.h"
    1717
    18 #include <memory>                  // for allocator_traits<>::value_type
    19 
    20 #include "Common/SemanticError.h"  // for SemanticError
    21 #include "SynTree/Declaration.h"   // for Declaration
    22 #include "SynTree/Expression.h"    // for Expression
    23 #include "SynTree/Label.h"         // for Label, noLabels
    24 #include "SynTree/Statement.h"     // for CatchStmt, Statement, CompoundStmt
     18#include "SynTree/Expression.h"
     19#include "SynTree/Statement.h"
    2520
    2621namespace GenPoly {
  • src/GenPoly/DeclMutator.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>               // for list
    19 #include <vector>             // for vector
     18#include <list>
     19#include <vector>
    2020
    21 #include "SynTree/Mutator.h"  // for Mutator
    22 #include "SynTree/SynTree.h"  // for Visitor Nodes
     21#include "SynTree/SynTree.h"
     22#include "SynTree/Declaration.h"
     23#include "SynTree/Mutator.h"
    2324
    2425namespace GenPoly {
  • src/GenPoly/FindFunction.cc

    r6ac5223 r97e3296  
    1515
    1616#include "FindFunction.h"
     17#include "SynTree/Type.h"
     18#include "SynTree/Declaration.h"
     19#include "SynTree/Visitor.h"
    1720
    18 #include <utility>                      // for pair
    19 
    20 #include "Common/SemanticError.h"       // for SemanticError
    21 #include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::iterator
    22 #include "GenPoly/GenPoly.h"            // for TyVarMap
    23 #include "ScrubTyVars.h"                // for ScrubTyVars
    24 #include "SynTree/Declaration.h"        // for DeclarationWithType, TypeDecl
    25 #include "SynTree/Mutator.h"            // for Mutator, mutateAll
    26 #include "SynTree/Type.h"               // for FunctionType, Type, Type::For...
     21#include "ScrubTyVars.h"
    2722
    2823namespace GenPoly {
  • src/GenPoly/FindFunction.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>       // for list
    19 
    20 #include "GenPoly.h"  // for TyVarMap
    21 
    22 class FunctionType;
    23 class Type;
     18#include "SynTree/SynTree.h"
     19#include "GenPoly.h"
    2420
    2521namespace GenPoly {
  • src/GenPoly/GenPoly.cc

    r6ac5223 r97e3296  
    1515
    1616#include "GenPoly.h"
    17 
    18 #include <cassert>                      // for assertf, assert
    19 #include <iostream>                     // for operator<<, ostream, basic_os...
    20 #include <iterator>                     // for back_insert_iterator, back_in...
    21 #include <list>                         // for list, _List_iterator, list<>:...
    22 #include <typeindex>                    // for type_index
    23 #include <utility>                      // for pair
    24 #include <vector>                       // for vector
    25 
    26 #include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
    27 #include "ResolvExpr/typeops.h"         // for flatten
    28 #include "SynTree/Constant.h"           // for Constant
    29 #include "SynTree/Expression.h"         // for Expression, TypeExpr, Constan...
    30 #include "SynTree/Type.h"               // for Type, StructInstType, UnionIn...
    31 #include "SynTree/TypeSubstitution.h"   // for TypeSubstitution
    32 
     17#include "assert.h"
     18
     19#include "SynTree/Expression.h"
     20#include "SynTree/Type.h"
     21#include "ResolvExpr/typeops.h"
     22
     23#include <iostream>
     24#include <iterator>
     25#include <list>
     26#include <typeindex>
     27#include <typeinfo>
     28#include <vector>
    3329using namespace std;
    3430
  • src/GenPoly/GenPoly.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <iostream>               // for ostream
    19 #include <string>                 // for string, allocator, operator+, basic...
     18#include <string>
     19#include <iostream>
     20#include <utility>
    2021
    21 #include "ErasableScopedMap.h"    // for ErasableScopedMap
    22 #include "SymTab/Mangler.h"       // for Mangler
    23 #include "SynTree/Declaration.h"  // for TypeDecl::Data, AggregateDecl, Type...
    24 #include "SynTree/SynTree.h"      // for Visitor Nodes
     22#include "ErasableScopedMap.h"
     23
     24#include "SymTab/Mangler.h"
     25
     26#include "SynTree/Declaration.h"
     27#include "SynTree/Type.h"
     28#include "SynTree/TypeSubstitution.h"
    2529
    2630namespace GenPoly {
     
    6266        Type *hasPolyBase( Type *type, const TyVarMap &tyVars, int *levels = 0, const TypeSubstitution *env = 0 );
    6367
    64         /// true iff this type or some base of this type after dereferencing pointers is either polymorphic or a generic type with at least one
     68        /// true iff this type or some base of this type after dereferencing pointers is either polymorphic or a generic type with at least one 
    6569        /// polymorphic parameter; will look up substitution in env if provided.
    6670        bool includesPolyType( Type *type, const TypeSubstitution *env = 0 );
    6771
    68         /// true iff this type or some base of this type after dereferencing pointers is either polymorphic in tyVars, or a generic type with
     72        /// true iff this type or some base of this type after dereferencing pointers is either polymorphic in tyVars, or a generic type with 
    6973        /// at least one polymorphic parameter in tyVars; will look up substitution in env if provided.
    7074        bool includesPolyType( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 );
  • src/GenPoly/InstantiateGeneric.cc

    r6ac5223 r97e3296  
    1313// Update Count     : 1
    1414//
     15
     16#include <cassert>
     17#include <list>
     18#include <unordered_map>
     19#include <utility>
     20#include <vector>
     21
    1522#include "InstantiateGeneric.h"
    1623
    17 #include <cassert>                     // for assertf, assert
    18 #include <iterator>                    // for back_inserter, inserter
    19 #include <list>                        // for list, _List_const_iterator
    20 #include <utility>                     // for move, pair
    21 #include <vector>                      // for vector
    22 
    23 #include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
    24 #include "Common/ScopedMap.h"          // for ScopedMap
    25 #include "Common/SemanticError.h"      // for SemanticError
    26 #include "Common/UniqueName.h"         // for UniqueName
    27 #include "Common/utility.h"            // for deleteAll, cloneAll
    28 #include "GenPoly.h"                   // for isPolyType, typesPolyCompatible
    29 #include "ScopedSet.h"                 // for ScopedSet, ScopedSet<>::iterator
    30 #include "ScrubTyVars.h"               // for ScrubTyVars
    31 #include "SynTree/Declaration.h"       // for StructDecl, UnionDecl, TypeDecl
    32 #include "SynTree/Expression.h"        // for TypeExpr, Expression
    33 #include "SynTree/Mutator.h"           // for mutateAll
    34 #include "SynTree/Type.h"              // for StructInstType, UnionInstType
    35 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
    36 #include "SynTree/Visitor.h"           // for acceptAll
     24#include "GenPoly.h"
     25#include "ScopedSet.h"
     26#include "ScrubTyVars.h"
     27
     28#include "Common/PassVisitor.h"
     29#include "Common/ScopedMap.h"
     30#include "Common/UniqueName.h"
     31#include "Common/utility.h"
     32
     33#include "ResolvExpr/typeops.h"
     34
     35#include "SynTree/Declaration.h"
     36#include "SynTree/Expression.h"
     37#include "SynTree/Type.h"
     38
     39
     40#include "InitTweak/InitTweak.h"
    3741
    3842
  • src/GenPoly/InstantiateGeneric.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>  // for list
    19 
    20 class Declaration;
     18#include "SynTree/SynTree.h"
    2119
    2220namespace GenPoly {
  • src/GenPoly/Lvalue.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                       // for safe_dynamic_cast
    17 #include <string>                        // for string
    18 
    19 #include "Common/SemanticError.h"        // for SemanticError
    20 #include "GenPoly.h"                     // for isPolyType
     16#include <cassert>
     17
    2118#include "Lvalue.h"
    22 #include "Parser/LinkageSpec.h"          // for Spec, isBuiltin, Intrinsic
    23 #include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
    24 #include "ResolvExpr/Unify.h"            // for unify
    25 #include "SymTab/Indexer.h"              // for Indexer
    26 #include "SynTree/Declaration.h"         // for Declaration, FunctionDecl
    27 #include "SynTree/Expression.h"          // for Expression, ConditionalExpr
    28 #include "SynTree/Mutator.h"             // for mutateAll, Mutator
    29 #include "SynTree/Statement.h"           // for ReturnStmt, Statement (ptr o...
    30 #include "SynTree/Type.h"                // for PointerType, Type, FunctionType
    31 #include "SynTree/Visitor.h"             // for Visitor, acceptAll
     19
     20#include "GenPoly.h"
     21
     22#include "SynTree/Declaration.h"
     23#include "SynTree/Type.h"
     24#include "SynTree/Expression.h"
     25#include "SynTree/Statement.h"
     26#include "SynTree/Visitor.h"
     27#include "SynTree/Mutator.h"
     28#include "SymTab/Indexer.h"
     29
     30#include "ResolvExpr/Resolver.h"
     31#include "ResolvExpr/TypeEnvironment.h"
     32#include "ResolvExpr/typeops.h"
     33#include "ResolvExpr/Unify.h"
     34
     35#include "Common/UniqueName.h"
     36#include "Common/utility.h"
    3237
    3338namespace GenPoly {
  • src/GenPoly/Lvalue.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>  // for list
     18#include <list>
    1919
    20 class Declaration;
    21 class Expression;
     20#include "SynTree/SynTree.h"
    2221
    2322namespace GenPoly {
  • src/GenPoly/PolyMutator.cc

    r6ac5223 r97e3296  
    1515
    1616#include "PolyMutator.h"
    17 
    18 #include "Common/SemanticError.h"  // for SemanticError
    19 #include "Common/utility.h"        // for ValueGuard
    20 #include "SynTree/Declaration.h"   // for Declaration, TypeDecl, TypeDecl::Data
    21 #include "SynTree/Expression.h"    // for Expression, UntypedExpr, StmtExpr ...
    22 #include "SynTree/Initializer.h"   // for SingleInit, Initializer (ptr only)
    23 #include "SynTree/Label.h"         // for Label, noLabels
    24 #include "SynTree/Mutator.h"       // for maybeMutate, mutateAll
    25 #include "SynTree/Statement.h"     // for CatchStmt, CompoundStmt, ForStmt
    26 
    27 class TypeSubstitution;
     17#include "SynTree/Declaration.h"
     18#include "SynTree/Type.h"
     19#include "SynTree/Expression.h"
     20#include "SynTree/Statement.h"
     21#include "SynTree/Mutator.h"
     22#include "SynTree/Initializer.h"
    2823
    2924namespace GenPoly {
  • src/GenPoly/PolyMutator.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>               // for list
     18#include <map>
     19#include <string>
     20#include <list>
    1921
    20 #include "GenPoly.h"          // for TyVarMap
    21 #include "SynTree/Mutator.h"  // for Mutator
    22 #include "SynTree/SynTree.h"  // for Visitor Nodes
     22#include "GenPoly.h"
     23
     24#include "SynTree/SynTree.h"
     25#include "SynTree/Declaration.h"
     26#include "SynTree/Mutator.h"
    2327
    2428namespace GenPoly {
  • src/GenPoly/ScrubTyVars.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <utility>                      // for pair
     16#include <sstream>
     17#include <string>
    1718
    18 #include "GenPoly.h"                    // for mangleType, TyVarMap, alignof...
    19 #include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
     19#include "GenPoly.h"
    2020#include "ScrubTyVars.h"
    21 #include "SynTree/Declaration.h"        // for TypeDecl, TypeDecl::Data, Typ...
    22 #include "SynTree/Expression.h"         // for Expression (ptr only), NameExpr
    23 #include "SynTree/Mutator.h"            // for Mutator
    24 #include "SynTree/Type.h"               // for PointerType, TypeInstType, Type
     21
     22#include "SynTree/Mutator.h"
     23#include "SynTree/Type.h"
     24#include "SynTree/Expression.h"
    2525
    2626namespace GenPoly {
  • src/GenPoly/ScrubTyVars.h

    r6ac5223 r97e3296  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ScrubTyVars.h --
     7// ScrubTyVars.h -- 
    88//
    99// Author           : Richard C. Bilson
     
    1616#pragma once
    1717
    18 #include <cassert>            // for assert
     18#include <string>
    1919
    20 #include "GenPoly.h"          // for TyVarMap, isPolyType, isDynType
    21 #include "SynTree/Mutator.h"  // for Mutator
    22 #include "SynTree/Type.h"     // for Type (ptr only), PointerType (ptr only)
     20#include "GenPoly.h"
    2321
    24 class AlignofExpr;
    25 class Expression;
    26 class SizeofExpr;
     22#include "SynTree/SynTree.h"
     23#include "SynTree/Mutator.h"
    2724
    2825namespace GenPoly {
     
    6966                        // return dynamicOnly ? isDynType( ty, tyVars ) : isPolyType( ty, tyVars );
    7067                }
    71 
     68               
    7269                /// Mutates (possibly generic) aggregate types appropriately
    7370                Type* mutateAggregateType( Type *ty );
    74 
     71               
    7572                const TyVarMap *tyVars;  ///< Type variables to scrub
    7673                ScrubMode mode;          ///< which type variables to scrub? [FromMap]
  • src/GenPoly/Specialize.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                       // for assert, assertf
    17 #include <iterator>                      // for back_insert_iterator, back_i...
    18 #include <map>                           // for _Rb_tree_iterator, _Rb_tree_...
    19 #include <memory>                        // for unique_ptr
    20 #include <string>                        // for string
    21 #include <tuple>                         // for get
    22 #include <utility>                       // for pair
    23 
    24 #include "Common/SemanticError.h"        // for SemanticError
    25 #include "Common/UniqueName.h"           // for UniqueName
    26 #include "Common/utility.h"              // for group_iterate
    27 #include "GenPoly.h"                     // for getFunctionType
    28 #include "InitTweak/InitTweak.h"         // for isIntrinsicCallExpr
    29 #include "Parser/LinkageSpec.h"          // for C
    30 #include "PolyMutator.h"                 // for PolyMutator
    31 #include "ResolvExpr/FindOpenVars.h"     // for findOpenVars
    32 #include "ResolvExpr/TypeEnvironment.h"  // for OpenVarSet, AssertionSet
     16#include <cassert>
     17
    3318#include "Specialize.h"
    34 #include "SynTree/Attribute.h"           // for Attribute
    35 #include "SynTree/Declaration.h"         // for FunctionDecl, DeclarationWit...
    36 #include "SynTree/Expression.h"          // for ApplicationExpr, Expression
    37 #include "SynTree/Label.h"               // for Label, noLabels
    38 #include "SynTree/Mutator.h"             // for mutateAll
    39 #include "SynTree/Statement.h"           // for CompoundStmt, DeclStmt, Expr...
    40 #include "SynTree/Type.h"                // for FunctionType, TupleType, Type
    41 #include "SynTree/TypeSubstitution.h"    // for TypeSubstitution
    42 #include "SynTree/Visitor.h"             // for Visitor
     19#include "GenPoly.h"
     20#include "PolyMutator.h"
     21
     22#include "Parser/ParseNode.h"
     23
     24#include "SynTree/Expression.h"
     25#include "SynTree/Statement.h"
     26#include "SynTree/Type.h"
     27#include "SynTree/Attribute.h"
     28#include "SynTree/TypeSubstitution.h"
     29#include "SynTree/Mutator.h"
     30#include "ResolvExpr/FindOpenVars.h"
     31#include "Common/UniqueName.h"
     32#include "Common/utility.h"
     33#include "InitTweak/InitTweak.h"
     34#include "Tuples/Tuples.h"
    4335
    4436namespace GenPoly {
  • src/GenPoly/Specialize.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>  // for list
     18#include <list>
    1919
    20 class Declaration;
     20#include "SynTree/SynTree.h"
    2121
    2222namespace GenPoly {
  • src/InitTweak/FixGlobalInit.cc

    r6ac5223 r97e3296  
    1515
    1616#include "FixGlobalInit.h"
    17 
    18 #include <cassert>                 // for assert
    19 #include <stddef.h>                // for NULL
    20 #include <algorithm>               // for replace_if
    21 
    22 #include "Common/SemanticError.h"  // for SemanticError
    23 #include "Common/UniqueName.h"     // for UniqueName
    24 #include "InitTweak.h"             // for isIntrinsicSingleArgCallStmt
    25 #include "Parser/LinkageSpec.h"    // for C
    26 #include "SynTree/Attribute.h"     // for Attribute
    27 #include "SynTree/Constant.h"      // for Constant
    28 #include "SynTree/Declaration.h"   // for FunctionDecl, ObjectDecl, Declaration
    29 #include "SynTree/Expression.h"    // for ConstantExpr, Expression (ptr only)
    30 #include "SynTree/Initializer.h"   // for ConstructorInit, Initializer
    31 #include "SynTree/Label.h"         // for Label, noLabels
    32 #include "SynTree/Statement.h"     // for CompoundStmt, Statement (ptr only)
    33 #include "SynTree/Type.h"          // for Type, Type::StorageClasses, Functi...
    34 #include "SynTree/Visitor.h"       // for acceptAll, Visitor
     17#include "InitTweak.h"
     18#include "SynTree/Declaration.h"
     19#include "SynTree/Type.h"
     20#include "SynTree/Expression.h"
     21#include "SynTree/Statement.h"
     22#include "SynTree/Initializer.h"
     23#include "SynTree/Visitor.h"
     24#include "SynTree/Attribute.h"
     25#include <algorithm>
    3526
    3627namespace InitTweak {
  • src/InitTweak/FixGlobalInit.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>    // for list
    19 #include <string>  // for string
     18#include <string>
     19#include <list>
    2020
    21 class Declaration;
     21#include "SynTree/SynTree.h"
     22#include "SynTree/Declaration.h"
    2223
    2324namespace InitTweak {
  • src/InitTweak/FixInit.cc

    r6ac5223 r97e3296  
    1313// Update Count     : 74
    1414//
     15
     16#include <stack>
     17#include <list>
     18#include <iterator>
     19#include <algorithm>
     20#include <unordered_map>
     21#include <unordered_set>
     22
     23#include "InitTweak.h"
     24#include "GenInit.h"
    1525#include "FixInit.h"
    16 
    17 #include <stddef.h>                    // for NULL
    18 #include <algorithm>                   // for set_difference, copy_if
    19 #include <cassert>                     // for assert, safe_dynamic_cast
    20 #include <iostream>                    // for operator<<, ostream, basic_ost...
    21 #include <iterator>                    // for insert_iterator, back_inserter
    22 #include <list>                        // for _List_iterator, list, list<>::...
    23 #include <map>                         // for _Rb_tree_iterator, _Rb_tree_co...
    24 #include <memory>                      // for allocator_traits<>::value_type
    25 #include <set>                         // for set, set<>::value_type
    26 #include <unordered_map>               // for unordered_map, unordered_map<>...
    27 #include <unordered_set>               // for unordered_set
    28 #include <utility>                     // for pair
    29 
    30 #include "CodeGen/GenType.h"           // for genPrettyType
    31 #include "Common/PassVisitor.h"        // for PassVisitor, WithStmtsToAdd
    32 #include "Common/SemanticError.h"      // for SemanticError
    33 #include "Common/UniqueName.h"         // for UniqueName
    34 #include "Common/utility.h"            // for CodeLocation, ValueGuard, toSt...
    35 #include "FixGlobalInit.h"             // for fixGlobalInit
    36 #include "GenInit.h"                   // for genCtorDtor
    37 #include "GenPoly/DeclMutator.h"       // for DeclMutator
    38 #include "GenPoly/GenPoly.h"           // for getFunctionType
    39 #include "GenPoly/PolyMutator.h"       // for PolyMutator
    40 #include "InitTweak.h"                 // for getFunctionName, getCallArg
    41 #include "Parser/LinkageSpec.h"        // for C, Spec, Cforall, isBuiltin
    42 #include "ResolvExpr/Resolver.h"       // for findVoidExpression
    43 #include "ResolvExpr/typeops.h"        // for typesCompatible
    44 #include "SymTab/Autogen.h"            // for genImplicitCall
    45 #include "SymTab/Indexer.h"            // for Indexer
    46 #include "SymTab/Mangler.h"            // for Mangler
    47 #include "SynTree/AddStmtVisitor.h"    // for AddStmtVisitor
    48 #include "SynTree/Attribute.h"         // for Attribute
    49 #include "SynTree/Constant.h"          // for Constant
    50 #include "SynTree/Declaration.h"       // for ObjectDecl, FunctionDecl, Decl...
    51 #include "SynTree/Expression.h"        // for UniqueExpr, VariableExpr, Unty...
    52 #include "SynTree/Initializer.h"       // for ConstructorInit, SingleInit
    53 #include "SynTree/Label.h"             // for Label, noLabels, operator<
    54 #include "SynTree/Mutator.h"           // for mutateAll, Mutator, maybeMutate
    55 #include "SynTree/Statement.h"         // for ExprStmt, CompoundStmt, Branch...
    56 #include "SynTree/Type.h"              // for Type, Type::StorageClasses
    57 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution, operator<<
    58 #include "SynTree/Visitor.h"           // for acceptAll, maybeAccept
    59 #include "Tuples/Tuples.h"             // for isTtype
     26#include "FixGlobalInit.h"
     27#include "CodeGen/GenType.h"  // for warning/error messages
     28#include "Common/PassVisitor.h"
     29#include "GenPoly/DeclMutator.h"
     30#include "GenPoly/PolyMutator.h"
     31#include "ResolvExpr/Resolver.h"
     32#include "ResolvExpr/typeops.h"
     33#include "SymTab/Autogen.h"
     34#include "SymTab/Indexer.h"
     35#include "SynTree/AddStmtVisitor.h"
     36#include "SynTree/Attribute.h"
     37#include "SynTree/Declaration.h"
     38#include "SynTree/Expression.h"
     39#include "SynTree/Initializer.h"
     40#include "SynTree/Mutator.h"
     41#include "SynTree/Statement.h"
     42#include "SynTree/Type.h"
     43#include "Tuples/Tuples.h"
    6044
    6145bool ctordtorp = false; // print all debug
  • src/InitTweak/FixInit.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>    // for list
    19 #include <string>  // for string
     18#include <string>
     19#include <list>
    2020
    21 class Declaration;
     21#include "SynTree/SynTree.h"
     22#include "SynTree/Declaration.h"
     23#include "SynTree/Mutator.h"
    2224
    2325namespace InitTweak {
  • src/InitTweak/GenInit.cc

    r6ac5223 r97e3296  
    1313// Update Count     : 183
    1414//
     15
     16#include <stack>
     17#include <list>
     18
     19#include "InitTweak.h"
    1520#include "GenInit.h"
    1621
    17 #include <stddef.h>                // for NULL
    18 #include <algorithm>               // for any_of
    19 #include <cassert>                 // for assert, safe_dynamic_cast, assertf
    20 #include <iterator>                // for back_inserter, inserter, back_inse...
    21 #include <list>                    // for _List_iterator, list
    22 
    23 #include "Common/PassVisitor.h"    // for PassVisitor, WithGuards, WithShort...
    24 #include "Common/SemanticError.h"  // for SemanticError
    25 #include "Common/UniqueName.h"     // for UniqueName
    26 #include "Common/utility.h"        // for ValueGuard, maybeClone
    27 #include "GenPoly/DeclMutator.h"   // for DeclMutator
    28 #include "GenPoly/GenPoly.h"       // for getFunctionType, isPolyType
    29 #include "GenPoly/ScopedSet.h"     // for ScopedSet, ScopedSet<>::const_iter...
    30 #include "InitTweak.h"             // for isConstExpr, InitExpander, checkIn...
    31 #include "Parser/LinkageSpec.h"    // for isOverridable, C
    32 #include "SymTab/Autogen.h"        // for genImplicitCall, SizeType
    33 #include "SymTab/Mangler.h"        // for Mangler
    34 #include "SynTree/Declaration.h"   // for ObjectDecl, DeclarationWithType
    35 #include "SynTree/Expression.h"    // for VariableExpr, UntypedExpr, Address...
    36 #include "SynTree/Initializer.h"   // for ConstructorInit, SingleInit, Initi...
    37 #include "SynTree/Label.h"         // for Label
    38 #include "SynTree/Mutator.h"       // for mutateAll
    39 #include "SynTree/Statement.h"     // for CompoundStmt, ImplicitCtorDtorStmt
    40 #include "SynTree/Type.h"          // for Type, ArrayType, Type::Qualifiers
    41 #include "SynTree/Visitor.h"       // for acceptAll, maybeAccept
     22#include "Common/PassVisitor.h"
     23
     24#include "GenPoly/DeclMutator.h"
     25#include "GenPoly/PolyMutator.h"
     26#include "GenPoly/ScopedSet.h"
     27
     28#include "ResolvExpr/typeops.h"
     29
     30#include "SynTree/Declaration.h"
     31#include "SynTree/Expression.h"
     32#include "SynTree/Initializer.h"
     33#include "SynTree/Mutator.h"
     34#include "SynTree/Statement.h"
     35#include "SynTree/Type.h"
     36
     37#include "SymTab/Autogen.h"
     38#include "SymTab/Mangler.h"
    4239
    4340namespace InitTweak {
  • src/InitTweak/GenInit.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>               // for list
    19 #include <string>             // for string
     18#include <string>
     19#include <list>
    2020
    21 #include "SynTree/SynTree.h"  // for Visitor Nodes
     21#include "SynTree/SynTree.h"
     22#include "SynTree/Declaration.h"
     23#include "SynTree/Mutator.h"
    2224
    2325namespace InitTweak {
  • src/InitTweak/InitTweak.cc

    r6ac5223 r97e3296  
    1 #include <stddef.h>                // for NULL
    2 #include <algorithm>               // for find, all_of
    3 #include <cassert>                 // for assertf, assert, safe_dynamic_cast
    4 #include <iostream>                // for ostream, cerr, endl
    5 #include <iterator>                // for back_insert_iterator, back_inserter
    6 #include <memory>                  // for __shared_ptr
    7 
    8 #include "Common/SemanticError.h"  // for SemanticError
    9 #include "Common/UniqueName.h"     // for UniqueName
    10 #include "Common/utility.h"        // for toString, deleteAll, maybeClone
    11 #include "GenPoly/GenPoly.h"       // for getFunctionType
     1#include <algorithm>
    122#include "InitTweak.h"
    13 #include "Parser/LinkageSpec.h"    // for Spec, isBuiltin, Intrinsic
    14 #include "ResolvExpr/typeops.h"    // for typesCompatibleIgnoreQualifiers
    15 #include "SymTab/Indexer.h"        // for Indexer
    16 #include "SynTree/Attribute.h"     // for Attribute
    17 #include "SynTree/Constant.h"      // for Constant
    18 #include "SynTree/Declaration.h"   // for ObjectDecl, DeclarationWithType
    19 #include "SynTree/Expression.h"    // for Expression, UntypedExpr, Applicati...
    20 #include "SynTree/Initializer.h"   // for Initializer, ListInit, Designation
    21 #include "SynTree/Label.h"         // for Label, noLabels
    22 #include "SynTree/Statement.h"     // for CompoundStmt, ExprStmt, BranchStmt
    23 #include "SynTree/Type.h"          // for FunctionType, ArrayType, PointerType
    24 #include "SynTree/Visitor.h"       // for Visitor, maybeAccept
    25 
    26 class UntypedValofExpr;
     3#include "SynTree/Visitor.h"
     4#include "SynTree/Statement.h"
     5#include "SynTree/Initializer.h"
     6#include "SynTree/Expression.h"
     7#include "SynTree/Attribute.h"
     8#include "GenPoly/GenPoly.h"
     9#include "ResolvExpr/typeops.h"
    2710
    2811namespace InitTweak {
  • src/InitTweak/InitTweak.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>               // for list
    19 #include <memory>             // for shared_ptr
    20 #include <string>             // for string, allocator
     18#include <string>
     19#include <list>
    2120
    22 #include "SynTree/SynTree.h"  // for Visitor Nodes
     21#include "SynTree/SynTree.h"
     22#include "SynTree/Declaration.h"
     23#include "SynTree/Mutator.h"
    2324
    2425// helper functions for initialization
     
    104105
    105106                class ExpanderImpl;
    106 
    107107                typedef std::list< Expression * > IndexList;
    108108        private:
  • src/Parser/DeclarationNode.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                 // for assert, assertf, safe_dynamic_cast
    17 #include <iterator>                // for back_insert_iterator
    18 #include <list>                    // for list
    19 #include <memory>                  // for unique_ptr
    20 #include <ostream>                 // for operator<<, ostream, basic_ostream
    21 #include <string>                  // for string, operator+, allocator, char...
    22 
    23 #include "Common/SemanticError.h"  // for SemanticError
    24 #include "Common/UniqueName.h"     // for UniqueName
    25 #include "Common/utility.h"        // for maybeClone, maybeBuild, CodeLocation
    26 #include "Parser/LinkageSpec.h"    // for Spec, linkageName, Cforall
    27 #include "Parser/ParseNode.h"      // for DeclarationNode, ExpressionNode
    28 #include "SynTree/Attribute.h"     // for Attribute
    29 #include "SynTree/Declaration.h"   // for TypeDecl, ObjectDecl, Declaration
    30 #include "SynTree/Expression.h"    // for Expression, ConstantExpr
    31 #include "SynTree/Statement.h"     // for AsmStmt
    32 #include "SynTree/Type.h"          // for Type, Type::StorageClasses, Type::...
    33 #include "TypeData.h"              // for TypeData, TypeData::Aggregate_t
    34 #include "TypedefTable.h"          // for TypedefTable, TypedefTable::kind_t...
    35 
    36 class Initializer;
    37 
     16#include <string>
     17#include <list>
     18#include <iterator>
     19#include <algorithm>
     20#include <cassert>
     21
     22#include "TypeData.h"
     23
     24#include "SynTree/Attribute.h"
     25#include "SynTree/Declaration.h"
     26#include "SynTree/Expression.h"
     27
     28#include "TypedefTable.h"
    3829extern TypedefTable typedefTable;
    3930
  • src/Parser/ExpressionNode.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                 // for assert
    17 #include <stdio.h>                 // for sscanf, size_t
    18 #include <climits>                 // for LLONG_MAX, LONG_MAX, INT_MAX, UINT...
    19 #include <list>                    // for list
    20 #include <sstream>                 // for basic_istream::operator>>, basic_i...
    21 #include <string>                  // for string, operator+, operator==
    22 
    23 #include "Common/SemanticError.h"  // for SemanticError
    24 #include "Common/utility.h"        // for maybeMoveBuild, maybeBuild, CodeLo...
    25 #include "ParseNode.h"             // for ExpressionNode, maybeMoveBuildType
    26 #include "SynTree/Constant.h"      // for Constant
    27 #include "SynTree/Declaration.h"   // for EnumDecl, StructDecl, UnionDecl
    28 #include "SynTree/Expression.h"    // for Expression, ConstantExpr, NameExpr
    29 #include "SynTree/Statement.h"     // for CompoundStmt, Statement
    30 #include "SynTree/Type.h"          // for BasicType, Type, Type::Qualifiers
    31 #include "parserutility.h"         // for notZeroExpr
    32 
    33 class Initializer;
     16#include <climits>                                                                              // access INT_MAX, UINT_MAX, LONG_MAX, ULONG_MAX, LLONG_MAX
     17#include <sstream>
     18
     19#include "ParseNode.h"
     20#include "TypeData.h"
     21#include "SynTree/Constant.h"
     22#include "SynTree/Expression.h"
     23#include "SynTree/Declaration.h"
     24#include "parserutility.h"
    3425
    3526using namespace std;
     
    7869                goto CLEANUP;
    7970        } // if
    80 
     71       
    8172        if ( str[0] == '0' ) {                                                          // octal/hex constant ?
    8273                dec = false;
  • src/Parser/InitializerNode.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <iostream>                // for operator<<, ostream, basic_ostream
    17 #include <list>                    // for list
    18 #include <string>                  // for operator<<, string
    19 
     16#include <cassert>
     17#include <iostream>
    2018using namespace std;
    2119
    22 #include "Common/SemanticError.h"  // for SemanticError
    23 #include "Common/utility.h"        // for maybeBuild
    24 #include "ParseNode.h"             // for InitializerNode, ExpressionNode
    25 #include "SynTree/Expression.h"    // for Expression
    26 #include "SynTree/Initializer.h"   // for Initializer, ListInit, SingleInit
     20#include "ParseNode.h"
     21#include "SynTree/Expression.h"
     22#include "SynTree/Initializer.h"
    2723
    2824InitializerNode::InitializerNode( ExpressionNode * _expr, bool aggrp, ExpressionNode * des )
  • src/Parser/ParseNode.h

    r6ac5223 r97e3296  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Aug 17 13:46:00 2017
    13 // Update Count     : 795
     12// Last Modified On : Thu Aug 10 16:54:00 2017
     13// Update Count     : 789
    1414//
    1515
    1616#pragma once
    1717
    18 #include <algorithm>               // for move
    19 #include <cassert>                 // for assert, assertf
    20 #include <iosfwd>                  // for ostream
    21 #include <iterator>                // for back_insert_iterator
    22 #include <list>                    // for list
    23 #include <memory>                  // for unique_ptr, pointer_traits
    24 #include <string>                  // for string
    25 
    26 #include "Common/CodeLocation.h"   // for CodeLocation
    27 #include "Common/SemanticError.h"  // for SemanticError
    28 #include "Common/UniqueName.h"     // for UniqueName
    29 #include "Common/utility.h"        // for maybeClone, maybeBuild
    30 #include "Parser/LinkageSpec.h"    // for Spec
    31 #include "SynTree/Expression.h"    // for Expression, ConstantExpr (ptr only)
    32 #include "SynTree/Label.h"         // for Label
    33 #include "SynTree/Statement.h"     // for Statement, BranchStmt, BranchStmt:...
    34 #include "SynTree/Type.h"          // for Type, Type::FuncSpecifiers, Type::...
    35 
     18#include <string>
     19#include <list>
     20#include <iterator>
     21#include <memory>
     22
     23#include "Parser/LinkageSpec.h"
     24#include "SynTree/Type.h"
     25#include "SynTree/Expression.h"
     26#include "SynTree/Statement.h"
     27#include "SynTree/Label.h"
     28#include "Common/utility.h"
     29#include "Common/UniqueName.h"
     30
     31class StatementNode;
     32class CompoundStmtNode;
     33class DeclarationNode;
     34class ExpressionNode;
     35class InitializerNode;
    3636class Attribute;
    37 class Declaration;
    38 class DeclarationNode;
    39 class DeclarationWithType;
    40 class ExpressionNode;
    41 class Initializer;
    42 class StatementNode;
    4337
    4438//##############################################################################
     
    377371Statement * build_expr( ExpressionNode * ctl );
    378372
    379 struct IfCtl {
    380         IfCtl( DeclarationNode * decl, ExpressionNode * condition ) :
    381                 init( decl ? new StatementNode( decl ) : nullptr ), condition( condition ) {}
    382 
    383         StatementNode * init;
    384         ExpressionNode * condition;
    385 };
    386 
    387373struct ForCtl {
    388374        ForCtl( ExpressionNode * expr, ExpressionNode * condition, ExpressionNode * change ) :
     
    396382};
    397383
    398 Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt );
     384Statement * build_if( ExpressionNode * ctl, StatementNode * then_stmt, StatementNode * else_stmt );
    399385Statement * build_switch( ExpressionNode * ctl, StatementNode * stmt );
    400386Statement * build_case( ExpressionNode * ctl );
  • src/Parser/StatementNode.cc

    r6ac5223 r97e3296  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 16 16:39:43 2017
    13 // Update Count     : 340
    14 //
    15 
    16 #include <cassert>                 // for assert, safe_dynamic_cast, assertf
    17 #include <list>                    // for list
    18 #include <memory>                  // for unique_ptr
    19 #include <string>                  // for string
    20 
    21 #include "Common/SemanticError.h"  // for SemanticError
    22 #include "Common/utility.h"        // for maybeMoveBuild, maybeBuild
    23 #include "ParseNode.h"             // for StatementNode, ExpressionNode, bui...
    24 #include "SynTree/Expression.h"    // for Expression, ConstantExpr
    25 #include "SynTree/Label.h"         // for Label, noLabels
    26 #include "SynTree/Statement.h"     // for Statement, BranchStmt, CaseStmt
    27 #include "parserutility.h"         // for notZeroExpr
    28 
    29 class Declaration;
     12// Last Modified On : Tue Jul 11 21:23:15 2017
     13// Update Count     : 331
     14//
     15
     16#include <list>
     17#include <algorithm>
     18#include <cassert>
     19
     20#include "ParseNode.h"
     21#include "SynTree/Statement.h"
     22#include "SynTree/Expression.h"
     23#include "parserutility.h"
     24#include "Common/utility.h"
    3025
    3126using namespace std;
     
    7974}
    8075
    81 Statement *build_if( IfCtl * ctl, StatementNode *then_stmt, StatementNode *else_stmt ) {
     76Statement *build_if( ExpressionNode *ctl, StatementNode *then_stmt, StatementNode *else_stmt ) {
    8277        Statement *thenb, *elseb = 0;
    8378        std::list< Statement * > branches;
     
    9287                elseb = branches.front();
    9388        } // if
    94        
    95         std::list< Statement * > init;
    96         if ( ctl->init != 0 ) {
    97                 buildMoveList( ctl->init, init );
    98         } // if
    99 
    100         return new IfStmt( noLabels, notZeroExpr(
    101                                                            /*ctl->condition
    102                                                                  ?*/ maybeMoveBuild< Expression >(ctl->condition)
    103                                                                  /*: new VariableExpr( init.end() )*/ )
    104                                                    , thenb, elseb );
    105         // ret->initialization = init;
    106         // delete ctl;
    107         // assert( ret );
    108         // return ret;
     89        return new IfStmt( noLabels, notZeroExpr( maybeMoveBuild< Expression >(ctl) ), thenb, elseb );
    10990}
    11091
  • src/Parser/TypeData.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                 // for assert
    17 #include <ostream>                 // for operator<<, ostream, basic_ostream
    18 
    19 #include "Common/SemanticError.h"  // for SemanticError
    20 #include "Common/utility.h"        // for maybeClone, maybeBuild, maybeMoveB...
    21 #include "Parser/ParseNode.h"      // for DeclarationNode, ExpressionNode
    22 #include "SynTree/Declaration.h"   // for TypeDecl, ObjectDecl, FunctionDecl
    23 #include "SynTree/Expression.h"    // for Expression, ConstantExpr (ptr only)
    24 #include "SynTree/Initializer.h"   // for SingleInit, Initializer (ptr only)
    25 #include "SynTree/Statement.h"     // for CompoundStmt, Statement
    26 #include "SynTree/Type.h"          // for BasicType, Type, Type::ForallList
     16#include <cassert>
     17#include <algorithm>
     18#include <iterator>
     19#include "Common/utility.h"
    2720#include "TypeData.h"
    28 
    29 class Attribute;
    30 
     21#include "SynTree/Type.h"
     22#include "SynTree/Declaration.h"
     23#include "SynTree/Expression.h"
     24#include "SynTree/Statement.h"
     25#include "SynTree/Initializer.h"
    3126using namespace std;
    3227
  • src/Parser/TypeData.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <iosfwd>                // for ostream
    19 #include <list>                  // for list
    20 #include <string>                // for string
    21 
    22 #include "ParseNode.h"           // for DeclarationNode, DeclarationNode::Ag...
    23 #include "Parser/LinkageSpec.h"  // for Spec
    24 #include "SynTree/Type.h"        // for Type, ReferenceToType (ptr only)
    25 #include "SynTree/SynTree.h"     // for Visitor Nodes
     18#include "ParseNode.h"
     19#include "SynTree/Type.h"
    2620
    2721struct TypeData {
  • src/Parser/TypedefTable.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <ext/alloc_traits.h>    // for __alloc_traits<>::value_type
    17 #include <cassert>               // for assert
    18 #include <list>                  // for list, _List_iterator, list<>::iterator
    19 #include <map>                   // for _Rb_tree_iterator, _Rb_tree_const_it...
    20 #include <memory>                // for allocator_traits<>::value_type
    21 #include <utility>               // for pair
    22 
    23 #include "Parser/ParserTypes.h"  // for typedefTable
    24 #include "Parser/parser.hh"      // for IDENTIFIER
     16#include <map>
     17#include <list>
     18#include <cassert>
    2519#include "TypedefTable.h"
    26 
    2720using namespace std;
    2821
    2922#if 0
    3023#include <iostream>
    31 
    3224#define debugPrint( x ) cerr << x
    3325#else
  • src/Parser/TypedefTable.h

    r6ac5223 r97e3296  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // TypedefTable.h --
     7// TypedefTable.h -- 
    88//
    99// Author           : Rodolfo G. Esteves
     
    1616#pragma once
    1717
    18 #include <list>       // for list
    19 #include <map>        // for map, map<>::value_compare
    20 #include <stack>      // for stack
    21 #include <string>     // for string
     18#include <map>
     19#include <list>
     20#include <string>
     21#include <stack>
    2222
    2323#include "ParserTypes.h"
    24 #include "parser.hh"  // for IDENTIFIER, TYPEDEFname, TYPEGENname
     24#include "parser.hh"
    2525
    2626class TypedefTable {
     
    3232                kind_t kind;
    3333        };
    34 
     34       
    3535        struct DeferredEntry {
    3636                std::string identifier;
     
    4444        std::string currentTrait;
    4545        int contextScope;
    46 
     46       
    4747        typedef std::list< DeferredEntry > deferListType;
    4848        std::stack< deferListType > deferListStack;
    4949        std::map< std::string, deferListType > contexts;
    50 
     50       
    5151        std::stack< std::string > nextIdentifiers;
    5252
     
    7070        void addToEnclosingScope( const std::string &identifier, kind_t kind );
    7171        void addToEnclosingScope( kind_t kind );                // use nextIdentifiers.top()
    72 
     72       
    7373        // "addToEnclosingScope2" adds the identifier/type pair to the scope that encloses the scope enclosing the the
    7474        // current one.  This is the right way to handle assertion names
    7575        void addToEnclosingScope2( const std::string &identifier, kind_t kind );
    7676        void addToEnclosingScope2( kind_t kind );               // use nextIdentifiers.top()
    77 
     77       
    7878        // set the next identifier to be used by an "add" operation without an identifier parameter within the current scope
    7979        void setNextIdentifier( const std::string &identifier );
    80 
     80       
    8181        // dump the definitions from a pre-defined context into the current scope
    8282        void openTrait( const std::string &contextName );
    83 
     83       
    8484        void enterScope();
    8585        void leaveScope();
  • src/Parser/parser.yy

    r6ac5223 r97e3296  
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat Sep  1 20:22:55 2001
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 16 18:09:14 2017
    13 // Update Count     : 2485
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Aug  4 13:33:00 2017
     13// Update Count     : 2475
    1414//
    1515
     
    9898        StatementNode * sn;
    9999        ConstantExpr * constant;
    100         IfCtl * ifctl;
    101100        ForCtl * fctl;
    102101        LabelNode * label;
     
    176175%type<en> comma_expression                              comma_expression_opt
    177176%type<en> argument_expression_list              argument_expression                     default_initialize_opt
    178 %type<ifctl> if_control_expression
    179177%type<fctl> for_control_expression
    180178%type<en> subrange
     
    796794
    797795selection_statement:
    798         IF '(' if_control_expression ')' statement                              %prec THEN
     796        IF '(' comma_expression ')' statement                           %prec THEN
    799797                // explicitly deal with the shift/reduce conflict on if/else
    800798                { $$ = new StatementNode( build_if( $3, $5, nullptr ) ); }
    801         | IF '(' if_control_expression ')' statement ELSE statement
     799        | IF '(' comma_expression ')' statement ELSE statement
    802800                { $$ = new StatementNode( build_if( $3, $5, $7 ) ); }
    803801        | SWITCH '(' comma_expression ')' case_clause           // CFA
     
    821819                }
    822820        ;
    823 
    824 if_control_expression:
    825         comma_expression
    826                 { $$ = new IfCtl( nullptr, $1 ); }
    827         | c_declaration                                                                         // no semi-coln
    828                 { $$ = new IfCtl( $1, nullptr ); }
    829         | cfa_declaration                                                                       // no semi-colon
    830                 { $$ = new IfCtl( $1, nullptr ); }
    831         | declaration comma_expression
    832                 { $$ = new IfCtl( $1, $2 ); }
    833         ;
    834821
    835822// CASE and DEFAULT clauses are only allowed in the SWITCH statement, precluding Duff's device. In addition, a case
     
    11101097
    11111098KR_declaration_list:
    1112         c_declaration ';'
    1113         | KR_declaration_list push c_declaration ';'
     1099        c_declaration
     1100        | KR_declaration_list push c_declaration
    11141101                { $$ = $1->appendList( $3 ); }
    11151102        ;
     
    11301117        ;
    11311118
    1132 declaration:                                                                                    // old & new style declarations
    1133         c_declaration ';'
    1134         | cfa_declaration ';'                                                           // CFA
     1119declaration:                                                                                    // CFA, new & old style declarations
     1120        cfa_declaration
     1121        | c_declaration
    11351122        ;
    11361123
     
    11471134
    11481135cfa_declaration:                                                                                // CFA
    1149         cfa_variable_declaration pop
    1150         | cfa_typedef_declaration pop
    1151         | cfa_function_declaration pop
    1152         | type_declaring_list pop
    1153         | trait_specifier pop
     1136        cfa_variable_declaration pop ';'
     1137        | cfa_typedef_declaration pop ';'
     1138        | cfa_function_declaration pop ';'
     1139        | type_declaring_list pop ';'
     1140        | trait_specifier pop ';'
    11541141        ;
    11551142
     
    13511338
    13521339c_declaration:
    1353         declaration_specifier declaring_list pop
     1340        declaration_specifier declaring_list pop ';'
    13541341                {
    13551342                        $$ = distAttr( $1, $2 );
    13561343                }
    1357         | typedef_declaration pop
    1358         | typedef_expression pop                                                        // GCC, naming expression type
    1359         | sue_declaration_specifier pop
     1344        | typedef_declaration pop ';'
     1345        | typedef_expression pop ';'                                            // GCC, naming expression type
     1346        | sue_declaration_specifier pop ';'
    13601347        ;
    13611348
  • src/Parser/parserutility.cc

    r6ac5223 r97e3296  
    1515
    1616#include "parserutility.h"
    17 
    18 #include <list>                  // for list
    19 #include <string>                // for string
    20 
    21 #include "SynTree/Constant.h"    // for Constant
    22 #include "SynTree/Expression.h"  // for UntypedExpr, CastExpr, ConstantExpr
    23 #include "SynTree/Type.h"        // for BasicType, ZeroType, BasicType::Kind...
     17#include "SynTree/Type.h"
     18#include "SynTree/Expression.h"
    2419
    2520// rewrite
  • src/Parser/parserutility.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 class Expression;
     18#include "SynTree/SynTree.h"
    1919
    2020Expression *notZeroExpr( Expression *orig );
  • src/ResolvExpr/AdjustExprType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include "SymTab/Indexer.h"       // for Indexer
    17 #include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Kind::Ftype
    18 #include "SynTree/Mutator.h"      // for Mutator
    19 #include "SynTree/Type.h"         // for PointerType, TypeInstType, Type
    20 #include "TypeEnvironment.h"      // for EqvClass, TypeEnvironment
     16#include "typeops.h"
     17#include "SynTree/Type.h"
     18#include "TypeEnvironment.h"
     19#include "SymTab/Indexer.h"
    2120
    2221namespace ResolvExpr {
  • src/ResolvExpr/Alternative.cc

    r6ac5223 r97e3296  
    1515
    1616#include "Alternative.h"
    17 
    18 #include <ostream>                       // for operator<<, ostream, basic_o...
    19 #include <string>                        // for operator<<, char_traits, string
    20 
    21 #include "Common/utility.h"              // for maybeClone
    22 #include "ResolvExpr/Cost.h"             // for Cost, Cost::zero, operator<<
    23 #include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment
    24 #include "SynTree/Expression.h"          // for Expression
    25 #include "SynTree/Type.h"                // for Type
     17#include "SynTree/Type.h"
     18#include "SynTree/Expression.h"
     19#include "Common/utility.h"
    2620
    2721namespace ResolvExpr {
  • src/ResolvExpr/Alternative.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <iosfwd>             // for ostream
    19 #include <list>               // for list
    20 
    21 #include "Cost.h"             // for Cost
    22 #include "TypeEnvironment.h"  // for TypeEnvironment
    23 
    24 class Expression;
     18#include <list>
     19#include "SynTree/SynTree.h"
     20#include "Cost.h"
     21#include "TypeEnvironment.h"
    2522
    2623namespace ResolvExpr {
    2724        struct Alternative;
    28 
    2925        typedef std::list< Alternative > AltList;
    3026
  • src/ResolvExpr/AlternativeFinder.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <algorithm>               // for copy
    17 #include <cassert>                 // for safe_dynamic_cast, assert, assertf
    18 #include <iostream>                // for operator<<, cerr, ostream, endl
    19 #include <iterator>                // for back_insert_iterator, back_inserter
    20 #include <list>                    // for _List_iterator, list, _List_const_...
    21 #include <map>                     // for _Rb_tree_iterator, map, _Rb_tree_c...
    22 #include <memory>                  // for allocator_traits<>::value_type
    23 #include <utility>                 // for pair
    24 
    25 #include "Alternative.h"           // for AltList, Alternative
     16#include <list>
     17#include <iterator>
     18#include <algorithm>
     19#include <functional>
     20#include <cassert>
     21#include <unordered_map>
     22#include <utility>
     23#include <vector>
     24
    2625#include "AlternativeFinder.h"
    27 #include "Common/SemanticError.h"  // for SemanticError
    28 #include "Common/utility.h"        // for deleteAll, printAll, CodeLocation
    29 #include "Cost.h"                  // for Cost, Cost::zero, operator<<, Cost...
    30 #include "InitTweak/InitTweak.h"   // for getFunctionName
    31 #include "RenameVars.h"            // for RenameVars, global_renamer
    32 #include "ResolveTypeof.h"         // for resolveTypeof
    33 #include "Resolver.h"              // for resolveStmtExpr
    34 #include "SymTab/Indexer.h"        // for Indexer
    35 #include "SymTab/Mangler.h"        // for Mangler
    36 #include "SymTab/Validate.h"       // for validateType
    37 #include "SynTree/Constant.h"      // for Constant
    38 #include "SynTree/Declaration.h"   // for DeclarationWithType, TypeDecl, Dec...
    39 #include "SynTree/Expression.h"    // for Expression, CastExpr, NameExpr
    40 #include "SynTree/Initializer.h"   // for SingleInit, operator<<, Designation
    41 #include "SynTree/SynTree.h"       // for UniqueId
    42 #include "SynTree/Type.h"          // for Type, FunctionType, PointerType
    43 #include "Tuples/Explode.h"        // for explode
    44 #include "Tuples/Tuples.h"         // for isTtype, handleTupleAssignment
    45 #include "Unify.h"                 // for unify
    46 #include "typeops.h"               // for adjustExprType, polyCost, castCost
     26#include "Alternative.h"
     27#include "Cost.h"
     28#include "typeops.h"
     29#include "Unify.h"
     30#include "RenameVars.h"
     31#include "SynTree/Type.h"
     32#include "SynTree/Declaration.h"
     33#include "SynTree/Expression.h"
     34#include "SynTree/Initializer.h"
     35#include "SynTree/Visitor.h"
     36#include "SymTab/Indexer.h"
     37#include "SymTab/Mangler.h"
     38#include "SynTree/TypeSubstitution.h"
     39#include "SymTab/Validate.h"
     40#include "Tuples/Tuples.h"
     41#include "Tuples/Explode.h"
     42#include "Common/utility.h"
     43#include "InitTweak/InitTweak.h"
     44#include "InitTweak/GenInit.h"
     45#include "ResolveTypeof.h"
     46#include "Resolver.h"
    4747
    4848extern bool resolvep;
     
    941941        void AlternativeFinder::visit( SizeofExpr *sizeofExpr ) {
    942942                if ( sizeofExpr->get_isType() ) {
    943                         Type * newType = sizeofExpr->get_type()->clone();
    944                         alternatives.push_back( Alternative( new SizeofExpr( resolveTypeof( newType, indexer ) ), env, Cost::zero ) );
     943                        // xxx - resolveTypeof?
     944                        alternatives.push_back( Alternative( sizeofExpr->clone(), env, Cost::zero ) );
    945945                } else {
    946946                        // find all alternatives for the argument to sizeof
     
    961961        void AlternativeFinder::visit( AlignofExpr *alignofExpr ) {
    962962                if ( alignofExpr->get_isType() ) {
    963                         Type * newType = alignofExpr->get_type()->clone();
    964                         alternatives.push_back( Alternative( new AlignofExpr( resolveTypeof( newType, indexer ) ), env, Cost::zero ) );
     963                        // xxx - resolveTypeof?
     964                        alternatives.push_back( Alternative( alignofExpr->clone(), env, Cost::zero ) );
    965965                } else {
    966966                        // find all alternatives for the argument to sizeof
  • src/ResolvExpr/AlternativeFinder.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <algorithm>                     // for copy
    19 #include <list>                          // for list
    20 #include <string>                        // for string
     18#include <set>
    2119
    22 #include "Alternative.h"                 // for AltList, Alternative
    23 #include "ResolvExpr/Cost.h"             // for Cost, Cost::infinity
    24 #include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
    25 #include "SynTree/Visitor.h"             // for Visitor
    26 #include "SynTree/SynTree.h"             // for Visitor Nodes
    27 
    28 namespace SymTab {
    29 class Indexer;
    30 }  // namespace SymTab
     20#include "Alternative.h"
     21#include "Unify.h"
     22#include "SynTree/SynTree.h"
     23#include "SymTab/Indexer.h"
     24#include "SynTree/TypeSubstitution.h"
    3125
    3226namespace ResolvExpr {
  • src/ResolvExpr/AlternativePrinter.cc

    r6ac5223 r97e3296  
    1515
    1616#include "AlternativePrinter.h"
    17 
    18 #include <list>                          // for _List_const_iterator, list<>...
    19 
    20 #include "Alternative.h"                 // for AltList, Alternative
    21 #include "AlternativeFinder.h"           // for AlternativeFinder
    22 #include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment
    23 #include "SynTree/Expression.h"          // for Expression
    24 #include "SynTree/Statement.h"           // for ExprStmt
    25 #include "SynTree/Type.h"                // for Type
     17#include "AlternativeFinder.h"
     18#include "Alternative.h"
     19#include "SynTree/Statement.h"
     20#include "SynTree/Type.h"
     21#include "SynTree/Expression.h"
     22#include "Common/utility.h"
    2623
    2724namespace ResolvExpr {
  • src/ResolvExpr/AlternativePrinter.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <iostream>          // for ostream
     18#include <iostream>
    1919
    20 #include "SymTab/Indexer.h"  // for Indexer
    21 
    22 class ExprStmt;
     20#include "Alternative.h"
     21#include "SymTab/Indexer.h"
    2322
    2423namespace ResolvExpr {
  • src/ResolvExpr/CastCost.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                       // for assert
    17 
    18 #include "ConversionCost.h"              // for ConversionCost
    19 #include "Cost.h"                        // for Cost, Cost::infinity
    20 #include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment, EqvClass
    21 #include "SymTab/Indexer.h"              // for Indexer
    22 #include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
    23 #include "SynTree/Type.h"                // for PointerType, Type, TypeInstType
    24 #include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
     16#include "typeops.h"
     17#include "Cost.h"
     18#include "ConversionCost.h"
     19#include "SynTree/Type.h"
     20#include "SynTree/Visitor.h"
     21#include "SymTab/Indexer.h"
    2522
    2623
  • src/ResolvExpr/CommonType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                       // for safe_dynamic_cast
    17 #include <map>                           // for _Rb_tree_const_iterator
    18 #include <utility>                       // for pair
    19 
    20 #include "ResolvExpr/TypeEnvironment.h"  // for OpenVarSet, AssertionSet
    21 #include "SymTab/Indexer.h"              // for Indexer
    22 #include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl (ptr...
    23 #include "SynTree/Type.h"                // for BasicType, BasicType::Kind::...
    24 #include "SynTree/Visitor.h"             // for Visitor
    25 #include "Unify.h"                       // for unifyExact, bindVar, WidenMode
    26 #include "typeops.h"                     // for isFtype
     16#include "typeops.h"
     17#include "SynTree/Type.h"
     18#include "Unify.h"
    2719
    2820
  • src/ResolvExpr/ConversionCost.cc

    r6ac5223 r97e3296  
    1515
    1616#include "ConversionCost.h"
    17 
    18 #include <cassert>                       // for assert
    19 #include <list>                          // for list, list<>::const_iterator
    20 #include <string>                        // for operator==, string
    21 
    22 #include "ResolvExpr/Cost.h"             // for Cost
    23 #include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
    24 #include "SymTab/Indexer.h"              // for Indexer
    25 #include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
    26 #include "SynTree/Type.h"                // for Type, BasicType, TypeInstType
    27 #include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
     17#include "typeops.h"
     18#include "SynTree/Type.h"
     19#include "SynTree/Visitor.h"
     20#include "SymTab/Indexer.h"
    2821
    2922namespace ResolvExpr {
  • src/ResolvExpr/ConversionCost.h

    r6ac5223 r97e3296  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ConversionCost.h --
     7// ConversionCost.h -- 
    88//
    99// Author           : Richard C. Bilson
     
    1616#pragma once
    1717
    18 #include "Cost.h"             // for Cost
    19 #include "SynTree/Visitor.h"  // for Visitor
    20 #include "SynTree/SynTree.h"  // for Visitor Nodes
    21 
    22 namespace SymTab {
    23 class Indexer;
    24 }  // namespace SymTab
     18#include "SynTree/Visitor.h"
     19#include "SymTab/Indexer.h"
     20#include "Cost.h"
     21#include "TypeEnvironment.h"
    2522
    2623namespace ResolvExpr {
    27 class TypeEnvironment;
    28 
    2924        class ConversionCost : public Visitor {
    3025          public:
    3126                ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
    32 
     27 
    3328                Cost get_cost() const { return cost; }
    3429
  • src/ResolvExpr/CurrentObject.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <stddef.h>                    // for size_t
    17 #include <cassert>                     // for assertf, assert, safe_dynamic_...
    18 #include <iostream>                    // for ostream, operator<<, basic_ost...
    19 #include <stack>                       // for stack
    20 #include <string>                      // for string, operator<<, allocator
    21 
    22 #include "Common/Indenter.h"           // for Indenter, operator<<
    23 #include "Common/SemanticError.h"      // for SemanticError
    24 #include "Common/utility.h"            // for toString
     16#include <stack>
     17#include <iostream>
     18
    2519#include "CurrentObject.h"
    26 #include "SynTree/Constant.h"          // for Constant
    27 #include "SynTree/Declaration.h"       // for ObjectDecl, Declaration, Struc...
    28 #include "SynTree/Expression.h"        // for InitAlternative, VariableExpr
    29 #include "SynTree/Initializer.h"       // for Designation, operator<<
    30 #include "SynTree/Type.h"              // for Type, StructInstType, UnionIns...
    31 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
     20
     21#include "Common/Indenter.h"
     22
     23#include "SynTree/Declaration.h"
     24#include "SynTree/Initializer.h"
     25#include "SynTree/Type.h"
     26#include "SynTree/TypeSubstitution.h"
    3227
    3328#if 0
  • src/ResolvExpr/CurrentObject.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>   // for list
    19 #include <stack>  // for stack
     18#include <stack>
    2019
    21 class Designation;
    22 class Type;
    23 struct InitAlternative;
     20#include "SynTree/SynTree.h"
     21#include "SynTree/Expression.h"
    2422
    2523namespace ResolvExpr {
  • src/ResolvExpr/FindOpenVars.cc

    r6ac5223 r97e3296  
    1515
    1616#include "FindOpenVars.h"
    17 
    18 #include <list>                   // for _List_const_iterator, list<>::const...
    19 #include <map>                    // for map<>::mapped_type
    20 
    21 #include "SynTree/Declaration.h"  // for TypeDecl, DeclarationWithType (ptr ...
    22 #include "SynTree/Type.h"         // for Type, Type::ForallList, ArrayType
    23 #include "SynTree/Visitor.h"      // for Visitor
     17#include "SynTree/Type.h"
     18#include "SynTree/Visitor.h"
    2419
    2520namespace ResolvExpr {
  • src/ResolvExpr/FindOpenVars.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
    19 
    20 class Type;
     18#include "Unify.h"
     19#include "SynTree/SynTree.h"
    2120
    2221namespace ResolvExpr {
  • src/ResolvExpr/Occurs.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <set>                // for set, _Rb_tree_const_iterator
    17 #include <string>             // for string
    18 
    19 #include "SynTree/Type.h"     // for TypeInstType, Type
    20 #include "SynTree/Visitor.h"  // for Visitor
    21 #include "TypeEnvironment.h"  // for EqvClass, TypeEnvironment
     16#include <set>
     17#include <algorithm>
     18#include <iterator>
     19#include "SynTree/Type.h"
     20#include "SynTree/Visitor.h"
     21#include "TypeEnvironment.h"
    2222
    2323namespace ResolvExpr {
  • src/ResolvExpr/PolyCost.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include "SymTab/Indexer.h"   // for Indexer
    17 #include "SynTree/Type.h"     // for TypeInstType, Type
    18 #include "SynTree/Visitor.h"  // for Visitor
    19 #include "TypeEnvironment.h"  // for EqvClass, TypeEnvironment
     16#include "typeops.h"
     17#include "SynTree/Type.h"
     18#include "SynTree/Visitor.h"
     19#include "SymTab/Indexer.h"
     20#include "TypeEnvironment.h"
    2021
    2122namespace ResolvExpr {
  • src/ResolvExpr/PtrsAssignable.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
    17 #include "SynTree/Type.h"                // for TypeInstType, Type, BasicType
    18 #include "SynTree/Visitor.h"             // for Visitor
     16#include "typeops.h"
     17#include "SynTree/Type.h"
     18#include "SynTree/Declaration.h"
     19#include "SynTree/Visitor.h"
    1920
    2021
  • src/ResolvExpr/PtrsCastable.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
    17 #include "SymTab/Indexer.h"              // for Indexer
    18 #include "SynTree/Declaration.h"         // for TypeDecl, TypeDecl::Kind::Ftype
    19 #include "SynTree/Type.h"                // for TypeInstType, Type, BasicType
    20 #include "SynTree/Visitor.h"             // for Visitor
    21 #include "typeops.h"                     // for ptrsAssignable
     16#include "typeops.h"
     17#include "SynTree/Type.h"
     18#include "SynTree/Declaration.h"
     19#include "SynTree/Visitor.h"
     20#include "SymTab/Indexer.h"
    2221
    2322
  • src/ResolvExpr/RenameVars.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <ext/alloc_traits.h>      // for __alloc_traits<>::value_type
    17 #include <memory>                  // for allocator_traits<>::value_type
    18 #include <sstream>                 // for operator<<, basic_ostream, ostring...
    19 #include <utility>                 // for pair
     16#include <sstream>
    2017
    21 #include "Common/SemanticError.h"  // for SemanticError
    2218#include "RenameVars.h"
    23 #include "SynTree/Declaration.h"   // for DeclarationWithType, TypeDecl, Dec...
    24 #include "SynTree/Expression.h"    // for Expression
    25 #include "SynTree/Type.h"          // for Type, TypeInstType, TraitInstType
    26 #include "SynTree/Visitor.h"       // for acceptAll, maybeAccept
     19#include "SynTree/Visitor.h"
     20#include "SynTree/Type.h"
     21#include "SynTree/Declaration.h"
     22#include "SynTree/Expression.h"
    2723
    2824namespace ResolvExpr {
  • src/ResolvExpr/RenameVars.h

    r6ac5223 r97e3296  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // RenameVars.h --
     7// RenameVars.h -- 
    88//
    99// Author           : Richard C. Bilson
     
    1616#pragma once
    1717
    18 #include <list>               // for list
    19 #include <map>                // for map
    20 #include <string>             // for string
     18#include <list>
     19#include <map>
     20#include <string>
    2121
    22 #include "SynTree/SynTree.h"  // for Visitor Nodes
    23 #include "SynTree/Visitor.h"  // for Visitor
     22#include "SynTree/SynTree.h"
     23#include "SynTree/Visitor.h"
    2424
    2525namespace ResolvExpr {
  • src/ResolvExpr/ResolveTypeof.cc

    r6ac5223 r97e3296  
    1515
    1616#include "ResolveTypeof.h"
    17 
    18 #include <cassert>               // for assert
    19 
    20 #include "Resolver.h"            // for resolveInVoidContext
    21 #include "SynTree/Expression.h"  // for Expression
    22 #include "SynTree/Mutator.h"     // for Mutator
    23 #include "SynTree/Type.h"        // for TypeofType, Type
    24 
    25 namespace SymTab {
    26 class Indexer;
    27 }  // namespace SymTab
     17#include "Alternative.h"
     18#include "AlternativeFinder.h"
     19#include "Resolver.h"
     20#include "TypeEnvironment.h"
     21#include "SynTree/Expression.h"
     22#include "SynTree/Type.h"
    2823
    2924namespace ResolvExpr {
  • src/ResolvExpr/ResolveTypeof.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 class Type;
    19 namespace SymTab {
    20 class Indexer;
    21 }  // namespace SymTab
     18#include "SynTree/SynTree.h"
     19#include "SymTab/Indexer.h"
    2220
    2321namespace ResolvExpr {
  • src/ResolvExpr/Resolver.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <stddef.h>                      // for NULL
    17 #include <cassert>                       // for safe_dynamic_cast, assert
    18 #include <memory>                        // for allocator, allocator_traits<...
    19 #include <tuple>                         // for get
    20 
    21 #include "Alternative.h"                 // for Alternative, AltList
    22 #include "AlternativeFinder.h"           // for AlternativeFinder, resolveIn...
    23 #include "Common/SemanticError.h"        // for SemanticError
    24 #include "Common/utility.h"              // for ValueGuard, group_iterate
    25 #include "CurrentObject.h"               // for CurrentObject
    26 #include "InitTweak/InitTweak.h"         // for isIntrinsicSingleArgCallStmt
    27 #include "RenameVars.h"                  // for RenameVars, global_renamer
    28 #include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment
    29 #include "ResolveTypeof.h"               // for resolveTypeof
     16#include <iostream>
     17
     18#include "Alternative.h"
     19#include "AlternativeFinder.h"
     20#include "CurrentObject.h"
     21#include "RenameVars.h"
    3022#include "Resolver.h"
    31 #include "SymTab/Autogen.h"              // for SizeType
    32 #include "SymTab/Indexer.h"              // for Indexer
    33 #include "SynTree/Declaration.h"         // for ObjectDecl, TypeDecl, Declar...
    34 #include "SynTree/Expression.h"          // for Expression, CastExpr, InitExpr
    35 #include "SynTree/Initializer.h"         // for ConstructorInit, SingleInit
    36 #include "SynTree/Statement.h"           // for ForStmt, Statement, BranchStmt
    37 #include "SynTree/Type.h"                // for Type, BasicType, PointerType
    38 #include "SynTree/TypeSubstitution.h"    // for TypeSubstitution
    39 #include "SynTree/Visitor.h"             // for acceptAll, maybeAccept
    40 #include "typeops.h"                     // for extractResultType
     23#include "ResolveTypeof.h"
     24#include "typeops.h"
     25
     26#include "SynTree/Expression.h"
     27#include "SynTree/Initializer.h"
     28#include "SynTree/Statement.h"
     29#include "SynTree/Type.h"
     30
     31#include "SymTab/Autogen.h"
     32#include "SymTab/Indexer.h"
     33
     34#include "Common/utility.h"
     35
     36#include "InitTweak/InitTweak.h"
    4137
    4238using namespace std;
     
    394390
    395391        void Resolver::visit( CatchStmt *catchStmt ) {
    396                 // inline Indexer::visit so that the exception variable is still in-scope for
    397                 // findSingleExpression() below
    398                 Parent::enterScope();
    399                 Visitor::visit( catchStmt );
     392                Parent::visit( catchStmt );
    400393               
    401394                if ( catchStmt->get_cond() ) {
     
    406399                        catchStmt->set_cond( findSingleExpression( wrapped, *this ) );
    407400                }
    408 
    409                 Parent::leaveScope();
    410401        }
    411402
  • src/ResolvExpr/Resolver.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>  // for list
    19 
    20 class ConstructorInit;
    21 class Declaration;
    22 class Expression;
    23 class StmtExpr;
    24 namespace SymTab {
    25 class Indexer;
    26 }  // namespace SymTab
     18#include "SynTree/SynTree.h"
     19#include "SymTab/Indexer.h"
    2720
    2821namespace ResolvExpr {
  • src/ResolvExpr/TypeEnvironment.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                     // for assert
    17 #include <algorithm>                   // for copy, set_intersection
    18 #include <iterator>                    // for ostream_iterator, insert_iterator
    19 #include <utility>                     // for pair
    20 
    21 #include "Common/utility.h"            // for maybeClone
    22 #include "SynTree/Type.h"              // for Type, FunctionType, Type::Fora...
    23 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
     16#include <algorithm>
     17#include <iterator>
     18
    2419#include "TypeEnvironment.h"
     20#include "SynTree/Type.h"
     21#include "SynTree/TypeSubstitution.h"
     22#include "Common/utility.h"
    2523
    2624namespace ResolvExpr {
  • src/ResolvExpr/TypeEnvironment.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <iostream>                    // for ostream
    19 #include <list>                        // for list, list<>::iterator, list<>...
    20 #include <map>                         // for map, map<>::value_compare
    21 #include <set>                         // for set
    22 #include <string>                      // for string
     18#include <string>
     19#include <set>
     20#include <list>
     21#include <iostream>
    2322
    24 #include "SynTree/Declaration.h"       // for TypeDecl::Data, DeclarationWit...
    25 #include "SynTree/SynTree.h"           // for UniqueId
    26 #include "SynTree/Type.h"              // for Type, Type::ForallList
    27 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
     23#include "SynTree/SynTree.h"
     24#include "SynTree/Type.h"
     25#include "SynTree/TypeSubstitution.h"
     26#include "SynTree/Declaration.h"
    2827
    2928namespace ResolvExpr {
  • src/ResolvExpr/Unify.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <cassert>                // for assertf, assert
    17 #include <iterator>               // for back_insert_iterator, back_inserter
    18 #include <map>                    // for _Rb_tree_const_iterator, _Rb_tree_i...
    19 #include <memory>                 // for unique_ptr, auto_ptr
    20 #include <set>                    // for set
    21 #include <string>                 // for string, operator==, operator!=, bas...
    22 #include <utility>                // for pair
    23 
    24 #include "FindOpenVars.h"         // for findOpenVars
    25 #include "Parser/LinkageSpec.h"   // for C
    26 #include "SynTree/Constant.h"     // for Constant
    27 #include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Data, Declarati...
    28 #include "SynTree/Expression.h"   // for TypeExpr, Expression, ConstantExpr
    29 #include "SynTree/Mutator.h"      // for Mutator
    30 #include "SynTree/Type.h"         // for Type, TypeInstType, FunctionType
    31 #include "SynTree/Visitor.h"      // for Visitor
    32 #include "Tuples/Tuples.h"        // for isTtype
    33 #include "TypeEnvironment.h"      // for EqvClass, AssertionSet, OpenVarSet
     16#include <set>
     17#include <memory>
     18
    3419#include "Unify.h"
    35 #include "typeops.h"              // for flatten, occurs, commonType
    36 
    37 namespace SymTab {
    38 class Indexer;
    39 }  // namespace SymTab
     20#include "TypeEnvironment.h"
     21#include "typeops.h"
     22#include "FindOpenVars.h"
     23#include "SynTree/Visitor.h"
     24#include "SynTree/Type.h"
     25#include "SynTree/Declaration.h"
     26#include "SymTab/Indexer.h"
     27#include "Common/utility.h"
     28#include "Tuples/Tuples.h"
    4029
    4130// #define DEBUG
  • src/ResolvExpr/Unify.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>                   // for list
    19 
    20 #include "Common/utility.h"       // for deleteAll
    21 #include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Data
    22 #include "TypeEnvironment.h"      // for AssertionSet, OpenVarSet
    23 
    24 class Type;
    25 class TypeInstType;
    26 namespace SymTab {
    27 class Indexer;
    28 }  // namespace SymTab
     18#include <map>
     19#include <list>
     20#include "SynTree/SynTree.h"
     21#include "SynTree/Type.h"
     22#include "SynTree/Declaration.h"
     23#include "SymTab/Indexer.h"
     24#include "TypeEnvironment.h"
     25#include "Common/utility.h"
    2926
    3027namespace ResolvExpr {
  • src/SymTab/Autogen.cc

    r6ac5223 r97e3296  
    1515#include "Autogen.h"
    1616
    17 #include <cstddef>                 // for NULL
    1817#include <algorithm>               // for count_if
    1918#include <cassert>                 // for safe_dynamic_cast, assert, assertf
     
    2120#include <list>                    // for list, _List_iterator, list<>::iter...
    2221#include <set>                     // for set, _Rb_tree_const_iterator
    23 #include <utility>                 // for pair
    2422#include <vector>                  // for vector
    2523
    26 #include "AddVisit.h"             // for addVisit
    27 #include "Common/ScopedMap.h"     // for ScopedMap
    28 #include "GenPoly/DeclMutator.h"  // for DeclMutator
    29 #include "GenPoly/ScopedSet.h"    // for ScopedSet
    30 #include "Parser/LinkageSpec.h"   // for AutoGen, Intrinsic, Spec
    31 #include "SymTab/Mangler.h"       // for mangleType
    32 #include "SynTree/Statement.h"    // for SwitchStmt (ptr only), CompoundStmt
    33 #include "SynTree/Type.h"         // for Type, ArrayType, Type::StorageClasses
    34 #include "SynTree/Visitor.h"      // for Visitor
     24#include "AddVisit.h"              // for addVisit
     25#include "Common/ScopedMap.h"      // for ScopedMap<>::const_iterator, Scope...
     26#include "Common/utility.h"        // for cloneAll, operator+
     27#include "GenPoly/DeclMutator.h"   // for DeclMutator
     28#include "GenPoly/ScopedSet.h"     // for ScopedSet, ScopedSet<>::iterator
     29#include "SymTab/Mangler.h"        // for Mangler
     30#include "SynTree/Mutator.h"       // for maybeMutate
     31#include "SynTree/Statement.h"     // for CompoundStmt, ReturnStmt, ExprStmt
     32#include "SynTree/Type.h"          // for FunctionType, Type, TypeInstType
     33#include "SynTree/Visitor.h"       // for maybeAccept, Visitor, acceptAll
     34
     35class Attribute;
    3536
    3637namespace SymTab {
  • src/SymTab/Autogen.h

    r6ac5223 r97e3296  
    1717
    1818#include <cassert>                // for assert
    19 #include <string>                 // for string
     19#include <iterator>               // for back_insert_iterator, back_inserter
     20#include <list>                   // for list
     21#include <string>                 // for string, operator==
    2022
    2123#include "Common/UniqueName.h"    // for UniqueName
    2224#include "InitTweak/InitTweak.h"  // for InitExpander
     25#include "Parser/LinkageSpec.h"   // for C
    2326#include "SynTree/Constant.h"     // for Constant
    24 #include "SynTree/Declaration.h"  // for DeclarationWithType, ObjectDecl
    25 #include "SynTree/Expression.h"   // for NameExpr, ConstantExpr, UntypedExpr...
     27#include "SynTree/Declaration.h"  // for ObjectDecl, Declaration (ptr only)
     28#include "SynTree/Expression.h"   // for UntypedExpr, NameExpr, VariableExpr
     29#include "SynTree/Initializer.h"  // for SingleInit
     30#include "SynTree/Label.h"        // for Label, noLabels
     31#include "SynTree/Statement.h"    // for Statement (ptr only), CompoundStmt
    2632#include "SynTree/Type.h"         // for Type, ArrayType, Type::Qualifiers
    27 
    28 class CompoundStmt;
    29 class Statement;
    3033
    3134namespace SymTab {
  • src/SymTab/FixFunction.cc

    r6ac5223 r97e3296  
    2020#include "Common/utility.h"       // for maybeClone
    2121#include "SynTree/Declaration.h"  // for FunctionDecl, ObjectDecl, Declarati...
    22 #include "SynTree/Expression.h"   // for Expression
    2322#include "SynTree/Type.h"         // for ArrayType, PointerType, Type, Basic...
    2423
  • src/SymTab/Indexer.cc

    r6ac5223 r97e3296  
    353353        }
    354354
    355         void Indexer::visit( ForStmt *forStmt ) {
    356             // for statements introduce a level of scope
    357             enterScope();
    358             Visitor::visit( forStmt );
    359             leaveScope();
    360         }
    361 
    362         void Indexer::visit( CatchStmt *catchStmt ) {
    363                 // catch statements introduce a level of scope (for the caught exception)
    364                 enterScope();
    365                 Visitor::visit( catchStmt );
    366                 leaveScope();
    367         }
    368355
    369356        void Indexer::visit( ApplicationExpr *applicationExpr ) {
     
    569556                leaveScope();
    570557        }
     558
     559        void Indexer::visit( ForStmt *forStmt ) {
     560            // for statements introduce a level of scope
     561            enterScope();
     562            Visitor::visit( forStmt );
     563            leaveScope();
     564        }
     565
     566
    571567
    572568        void Indexer::lookupId( const std::string &id, std::list< DeclarationWithType* > &out ) const {
  • src/SymTab/Indexer.h

    r6ac5223 r97e3296  
    4545
    4646                virtual void visit( CompoundStmt *compoundStmt );
    47                 virtual void visit( ForStmt *forStmt );
    48                 virtual void visit( CatchStmt *catchStmt );
    4947
    5048                virtual void visit( ApplicationExpr *applicationExpr );
     
    8381                virtual void visit( StructInstType *contextInst );
    8482                virtual void visit( UnionInstType *contextInst );
     83
     84                virtual void visit( ForStmt *forStmt );
    8585
    8686                // when using an indexer manually (e.g., within a mutator traversal), it is necessary to tell the indexer
  • src/SymTab/Mangler.cc

    r6ac5223 r97e3296  
    2020#include <iterator>                 // for ostream_iterator, back_insert_ite...
    2121#include <list>                     // for _List_iterator, list, _List_const...
    22 #include <string>                   // for string, char_traits, operator<<
     22#include <string>                   // for string, operator<<, basic_string
    2323
    2424#include "CodeGen/OperatorTable.h"  // for OperatorInfo, operatorLookup
    25 #include "Common/SemanticError.h"   // for SemanticError
    2625#include "Common/utility.h"         // for toString
    2726#include "Parser/LinkageSpec.h"     // for Spec, isOverridable, AutoGen, Int...
  • src/SymTab/Validate.cc

    r6ac5223 r97e3296  
    4040#include "Validate.h"
    4141
    42 #include <cassert>                     // for assertf, assert
    4342#include <cstddef>                     // for size_t
    44 #include <list>                        // for list
    45 #include <string>                      // for string
    46 #include <utility>                     // for pair
    47 
     43#include <algorithm>                   // for move, transform
     44#include <cassert>                     // for safe_dynamic_cast, assertf
     45#include <iterator>                    // for back_inserter, inserter, back_...
     46#include <list>                        // for list, _List_iterator, list<>::...
     47#include <map>                         // for _Rb_tree_iterator, map, map<>:...
     48#include <memory>                      // for unique_ptr, allocator
     49#include <string>                      // for string, operator+, operator==
     50#include <tuple>                       // for get
     51#include <utility>                     // for pair, make_pair
     52
     53#include "AddVisit.h"                  // for addVisit
     54#include "Autogen.h"                   // for SizeType, autogenerateRoutines
    4855#include "CodeGen/CodeGenerator.h"     // for genName
    4956#include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
    50 #include "Common/ScopedMap.h"          // for ScopedMap
     57#include "Common/ScopedMap.h"          // for ScopedMap<>::const_iterator
    5158#include "Common/SemanticError.h"      // for SemanticError
    5259#include "Common/UniqueName.h"         // for UniqueName
    5360#include "Common/utility.h"            // for operator+, cloneAll, deleteAll
    54 #include "Concurrency/Keywords.h"      // for applyKeywords
     61#include "Concurrency/Keywords.h"      // for applyKeywords, implementMutexF...
    5562#include "FixFunction.h"               // for FixFunction
    5663#include "Indexer.h"                   // for Indexer
    57 #include "InitTweak/InitTweak.h"       // for isCtorDtorAssign
    58 #include "Parser/LinkageSpec.h"        // for C
    59 #include "ResolvExpr/typeops.h"        // for typesCompatible
    60 #include "SymTab/AddVisit.h"           // for addVisit
    61 #include "SymTab/Autogen.h"            // for SizeType
    62 #include "SynTree/Attribute.h"         // for noAttributes, Attribute
     64#include "InitTweak/InitTweak.h"       // for isCtorDtor, isCtorDtorAssign
     65#include "Parser/LinkageSpec.h"        // for C, Cforall
     66#include "ResolvExpr/typeops.h"        // for extractResultType, typesCompat...
     67#include "SynTree/Attribute.h"         // for Attribute
    6368#include "SynTree/Constant.h"          // for Constant
    64 #include "SynTree/Declaration.h"       // for ObjectDecl, DeclarationWithType
    65 #include "SynTree/Expression.h"        // for CompoundLiteralExpr, Expressio...
    66 #include "SynTree/Initializer.h"       // for ListInit, Initializer
    67 #include "SynTree/Label.h"             // for operator==, Label
    68 #include "SynTree/Mutator.h"           // for Mutator
    69 #include "SynTree/Type.h"              // for Type, TypeInstType, EnumInstType
    70 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
    71 #include "SynTree/Visitor.h"           // for Visitor
    72 
    73 class CompoundStmt;
    74 class ReturnStmt;
    75 class SwitchStmt;
    76 
     69#include "SynTree/Declaration.h"       // for EnumDecl, StructDecl, UnionDecl
     70#include "SynTree/Expression.h"        // for TypeExpr, CompoundLiteralExpr
     71#include "SynTree/Initializer.h"       // for ListInit, Initializer, noDesig...
     72#include "SynTree/Mutator.h"           // for mutateAll, Mutator
     73#include "SynTree/Statement.h"         // for CompoundStmt, DeclStmt, Return...
     74#include "SynTree/Type.h"              // for Type, TypeInstType, TraitInstType
     75#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution, applySubstit...
     76#include "SynTree/Visitor.h"           // for acceptAll, Visitor
    7777
    7878#define debugPrint( x ) if ( doDebug ) { std::cout << x; }
  • src/SynTree/AddStmtVisitor.cc

    r6ac5223 r97e3296  
    1515
    1616#include "AddStmtVisitor.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
     17#include "Statement.h"
     18#include "Declaration.h"
     19#include "Expression.h"
     20#include "Common/utility.h"
    2321
    2422void AddStmtVisitor::visitStatementList( std::list< Statement* > &statements ) {
  • src/SynTree/AddStmtVisitor.h

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

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include "Expression.h"
     17#include "Type.h"
     18#include "Common/utility.h"
    2219
    2320AddressExpr::AddressExpr( Expression *arg, Expression *_aname ) : Expression( _aname ), arg( arg ) {
  • src/SynTree/AggregateDecl.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include "Declaration.h"
     17#include "Attribute.h"
     18#include "Type.h"
     19#include "Common/utility.h"
    2520
    2621
  • src/SynTree/ApplicationExpr.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include <cassert>
    2317
    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
     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"
    2924
    3025ParamEntry::ParamEntry( const ParamEntry &other ) :
  • src/SynTree/ArrayType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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 
    23 class Attribute;
     16#include "Type.h"
     17#include "Expression.h"
     18#include "Common/utility.h"
    2419
    2520
  • src/SynTree/AttrType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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 
    24 class Attribute;
     16#include "Type.h"
     17#include "Expression.h"
     18#include "Common/utility.h"
    2519
    2620
  • src/SynTree/Attribute.cc

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

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

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

    r6ac5223 r97e3296  
    1414//
    1515
    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 
    22 class Attribute;
     16#include <cassert>
     17#include "Type.h"
    2318
    2419BasicType::BasicType( const Type::Qualifiers &tq, Kind bt, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), kind( bt ) {}
  • src/SynTree/CommaExpr.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include "Expression.h"
     17#include "Type.h"
     18#include "Common/utility.h"
    2219
    2320CommaExpr::CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname )
  • src/SynTree/CompoundStmt.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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...
     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"
    2623
    2724using std::string;
  • src/SynTree/Constant.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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<<
     16#include <iostream>
     17#include <list>
     18#include <string>
    1919
    2020#include "Constant.h"
    21 #include "Type.h"    // for BasicType, Type, Type::Qualifiers, PointerType
     21#include "Type.h"
    2222
    2323Constant::Constant( Type * type, std::string rep, unsigned long long val ) : type( type ), rep( rep ), val( val ) {}
  • src/SynTree/Constant.h

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

    r6ac5223 r97e3296  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // DeclStmt.cc --
     7// DeclStmt.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    1414//
    1515
    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
     16#include "Statement.h"
     17#include "Declaration.h"
     18#include "Common/utility.h"
    2419
    2520DeclStmt::DeclStmt( std::list<Label> labels, Declaration *decl ) : Statement( labels ), decl( decl ) {
  • src/SynTree/Declaration.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include <string>
     17#include <map>
    2218#include "Declaration.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
     19#include "Expression.h"
     20#include "Initializer.h"
     21#include "Type.h"
     22#include "Attribute.h"
     23#include "Common/utility.h"
    2724
    2825static UniqueId lastUniqueId = 0;
  • src/SynTree/Declaration.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    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 
    31 class AsmStmt;
    32 class Attribute;
    33 class CompoundStmt;
    34 class ConstantExpr;
    35 class Expression;
    36 class Initializer;
    37 class TypeDecl;
     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"
    3826
    3927class Declaration : public BaseSyntaxNode {
  • src/SynTree/DeclarationWithType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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...
     16#include "Declaration.h"
     17#include "Type.h"
     18#include "Attribute.h"
     19#include "Common/utility.h"
    2520
    2621DeclarationWithType::DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs )
  • src/SynTree/Expression.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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
     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"
    3235
    3336
  • src/SynTree/Expression.h

    r6ac5223 r97e3296  
    1313// Update Count     : 44
    1414//
     15
    1516#pragma once
    1617
    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 
     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"
    3027
    3128/// Expression is the root type for all expressions
     
    6057
    6158struct ParamEntry;
    62 
    6359typedef std::map< UniqueId, ParamEntry > InferredParams;
    6460
  • src/SynTree/FunctionDecl.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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...
     16#include <cassert>
    2017
    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...
     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"
    2825
    2926extern bool translation_unit_nomain;
  • src/SynTree/FunctionType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <list>              // for list
    17 #include <ostream>           // for operator<<, basic_ostream, ostream, endl
    18 #include <string>            // for operator<<, char_traits, string
     16#include <algorithm>
    1917
    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 
    25 class Attribute;
     18#include "Type.h"
     19#include "Declaration.h"
     20#include "Common/utility.h"
     21#include "Tuples/Tuples.h"
    2622
    2723FunctionType::FunctionType( const Type::Qualifiers &tq, bool isVarArgs, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), isVarArgs( isVarArgs ) {
  • src/SynTree/Initializer.cc

    r6ac5223 r97e3296  
    1515
    1616#include "Initializer.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
     17#include "Expression.h"
     18#include "Statement.h"
     19#include "Common/utility.h"
    2620
    2721Designation::Designation( const std::list< Expression * > & designators ) : designators( designators ) {}
  • src/SynTree/Initializer.h

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

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include <cassert>
    2217#include "Mutator.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 
    27 class Constant;
    28 class Subrange;
     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"
    2926
    3027Mutator::Mutator() {}
  • src/SynTree/Mutator.h

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

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include "Declaration.h"
     17#include "Type.h"
     18#include "Common/utility.h"
    2419
    2520NamedTypeDecl::NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *base )
  • src/SynTree/ObjectDecl.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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...
     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"
    2723
    2824ObjectDecl::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

    r6ac5223 r97e3296  
    1414//
    1515
    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 
    23 class Attribute;
     16#include "Type.h"
     17#include "Expression.h"
     18#include "Common/utility.h"
    2419
    2520PointerType::PointerType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes )
  • src/SynTree/ReferenceToType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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==
     16#include <string>
     17#include <cassert>
    2118
    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 
    27 class Attribute;
     19#include "Type.h"
     20#include "Declaration.h"
     21#include "Expression.h"
     22#include "TypeSubstitution.h"
     23#include "Common/utility.h"
    2824
    2925ReferenceToType::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

    r6ac5223 r97e3296  
    1414//
    1515
    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<<
     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"
    3026
    3127using std::string;
  • src/SynTree/Statement.h

    r6ac5223 r97e3296  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 16 16:28:55 2017
    13 // Update Count     : 70
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug  3 14:08:00 2017
     13// Update Count     : 69
    1414//
    1515
    1616#pragma once
    1717
    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 
    28 class CatchStmt;
    29 class ConstantExpr;
    30 class Declaration;
    31 class Expression;
    32 class FinallyStmt;
     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"
    3325
    3426class Statement : public BaseSyntaxNode {
     
    127119class IfStmt : public Statement {
    128120  public:
    129         std::list<Statement *> initialization;
    130121        Expression *condition;
    131122        Statement *thenPart;
     
    136127        virtual ~IfStmt();
    137128
    138         std::list<Statement *> &get_initialization() { return initialization; }
    139         void set_initialization( std::list<Statement *> newValue ) { initialization = newValue; }
    140129        Expression *get_condition() { return condition; }
    141130        void set_condition( Expression *newValue ) { condition = newValue; }
  • src/SynTree/TupleExpr.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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
     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"
    2922
    3023UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname ) : Expression( _aname ), exprs( exprs ) {
  • src/SynTree/TupleType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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 
    25 class Attribute;
     16#include "Declaration.h"
     17#include "Initializer.h"
     18#include "Type.h"
     19#include "Common/utility.h"
     20#include "Parser/LinkageSpec.h"
    2621
    2722TupleType::TupleType( const Type::Qualifiers &tq, const std::list< Type * > & types, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), types( types ) {
  • src/SynTree/Type.cc

    r6ac5223 r97e3296  
    1313// Update Count     : 29
    1414//
     15
     16#include "SynTree.h"
     17#include "Visitor.h"
    1518#include "Type.h"
    16 
    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
     19#include "Declaration.h"
     20#include "Attribute.h"
     21#include "InitTweak/InitTweak.h"
     22#include "Common/utility.h"
    2223
    2324using namespace std;
  • src/SynTree/Type.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    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
     18#include "BaseSyntaxNode.h"
     19#include "Mutator.h"
     20#include "SynTree.h"
     21#include "Visitor.h"
     22#include <strings.h>                                                                    // ffs
    2923
    3024class Type : public BaseSyntaxNode {
  • src/SynTree/TypeDecl.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include "Declaration.h"
     17#include "Type.h"
     18#include "Common/utility.h"
    2219
    2320TypeDecl::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

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include "Expression.h"
     17#include "Type.h"
     18#include "Common/utility.h"
    2119
    2220TypeExpr::TypeExpr( Type *type ) : type( type ) {
  • src/SynTree/TypeSubstitution.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <ostream>  // for ostream, basic_ostream, operator<<, endl
    17 
    18 #include "Type.h"   // for TypeInstType, Type, StructInstType, UnionInstType
     16#include "Type.h"
    1917#include "TypeSubstitution.h"
    2018
  • src/SynTree/TypeSubstitution.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    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
     18#include <map>
     19#include <set>
     20#include <cassert>
    2521
    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...
     22#include "SynTree/Mutator.h"
     23#include "SynTree/Declaration.h"
     24#include "SynTree/Expression.h"
    3125
    3226class TypeSubstitution : public Mutator {
  • src/SynTree/TypeofType.cc

    r6ac5223 r97e3296  
    1414//
    1515
    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 
    23 class Attribute;
     16#include "Type.h"
     17#include "Expression.h"
     18#include "Common/utility.h"
    2419
    2520TypeofType::TypeofType( const Type::Qualifiers &tq, Expression *expr, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), expr( expr ) {
  • src/SynTree/VarArgsType.cc

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

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <iostream>       // for operator<<, basic_ostream, ostream, basic_o...
    17 
    18 #include "Declaration.h"  // for operator<<, DeclarationWithType
    19 #include "Expression.h"   // for VariableExpr
     16#include "Declaration.h"
     17#include "Expression.h"
    2018#include "VarExprReplacer.h"
    2119
  • src/SynTree/VarExprReplacer.h

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

    r6ac5223 r97e3296  
    1414//
    1515
    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
     16#include <cassert>
    2517#include "Visitor.h"
    26 
    27 class Subrange;
     18#include "Initializer.h"
     19#include "Statement.h"
     20#include "Type.h"
     21#include "Declaration.h"
     22#include "Expression.h"
     23#include "Constant.h"
    2824
    2925Visitor::Visitor() {}
  • src/SynTree/Visitor.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include "Common/SemanticError.h"  // for SemanticError
    19 #include "SynTree.h"               // for AST nodes
     18#include "SynTree.h"
     19#include "Common/SemanticError.h"
     20#include "Common/CompilerError.h"
    2021
    2122class Visitor {
  • src/SynTree/VoidType.cc

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

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <list>     // for list
    17 #include <ostream>  // for operator<<, ostream
    18 
    19 #include "Type.h"   // for Type, Type::Qualifiers, OneType, ZeroType
    20 
    21 class Attribute;
     16#include "Type.h"
    2217
    2318ZeroType::ZeroType() : Type( Type::Qualifiers(), std::list< Attribute * >() ) {}
  • src/Tuples/Explode.cc

    r6ac5223 r97e3296  
    1515
    1616#include "Explode.h"
    17 
    18 #include <list>               // for list
    19 
    20 #include "SynTree/Mutator.h"  // for Mutator
     17#include "SynTree/Mutator.h"
    2118
    2219namespace Tuples {
  • src/Tuples/Explode.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <iterator>                  // for back_inserter, back_insert_iterator
     18#include "ResolvExpr/AlternativeFinder.h"
     19#include "ResolvExpr/Resolver.h"
    1920
    20 #include "ResolvExpr/Alternative.h"  // for Alternative, AltList
    21 #include "SynTree/Expression.h"      // for Expression, UniqueExpr, AddressExpr
    22 #include "SynTree/Type.h"            // for TupleType, Type
    23 #include "Tuples.h"                  // for maybeImpure
     21#include "SynTree/Expression.h"
     22#include "SynTree/Declaration.h"
     23#include "SynTree/Type.h"
    2424
    25 namespace SymTab {
    26 class Indexer;
    27 }  // namespace SymTab
     25#include "Tuples.h"
    2826
    2927namespace Tuples {
  • src/Tuples/TupleAssignment.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <algorithm>                       // for transform
    17 #include <cassert>                         // for assert
    18 #include <iterator>                        // for back_insert_iterator, back...
    19 #include <list>                            // for _List_const_iterator, _Lis...
    20 #include <memory>                          // for unique_ptr, allocator_trai...
    21 #include <string>                          // for string
    22 
    23 #include "Common/UniqueName.h"             // for UniqueName
    24 #include "Common/utility.h"                // for zipWith
    25 #include "Explode.h"                       // for explode
    26 #include "InitTweak/GenInit.h"             // for genCtorInit
    27 #include "InitTweak/InitTweak.h"           // for getPointerBase, isAssignment
    28 #include "Parser/LinkageSpec.h"            // for Cforall
    29 #include "ResolvExpr/Alternative.h"        // for AltList, Alternative
    30 #include "ResolvExpr/AlternativeFinder.h"  // for AlternativeFinder, simpleC...
    31 #include "ResolvExpr/Cost.h"               // for Cost
    32 #include "ResolvExpr/Resolver.h"           // for resolveCtorInit
    33 #include "ResolvExpr/TypeEnvironment.h"    // for TypeEnvironment
    34 #include "SynTree/Declaration.h"           // for ObjectDecl
    35 #include "SynTree/Expression.h"            // for Expression, CastExpr, Name...
    36 #include "SynTree/Initializer.h"           // for ConstructorInit, SingleInit
    37 #include "SynTree/Statement.h"             // for ExprStmt
    38 #include "SynTree/Type.h"                  // for Type, Type::Qualifiers
    39 #include "SynTree/TypeSubstitution.h"      // for TypeSubstitution
    40 #include "SynTree/Visitor.h"               // for Visitor
     16#include "ResolvExpr/AlternativeFinder.h"
     17#include "ResolvExpr/Alternative.h"
     18#include "ResolvExpr/typeops.h"
     19#include "SynTree/Expression.h"
     20#include "SynTree/Initializer.h"
     21#include "Tuples.h"
     22#include "Explode.h"
     23#include "Common/SemanticError.h"
     24#include "InitTweak/InitTweak.h"
     25#include "InitTweak/GenInit.h"
     26
     27#include <functional>
     28#include <algorithm>
     29#include <iterator>
     30#include <iostream>
     31#include <cassert>
     32#include <set>
     33#include <unordered_set>
    4134
    4235namespace Tuples {
  • src/Tuples/TupleExpansion.cc

    r6ac5223 r97e3296  
    1414//
    1515
    16 #include <stddef.h>               // for size_t
    17 #include <cassert>                // for assert
    18 #include <list>                   // for list
    19 
    20 #include "Common/PassVisitor.h"   // for PassVisitor, WithDeclsToAdd, WithGu...
    21 #include "Common/ScopedMap.h"     // for ScopedMap
    22 #include "Common/utility.h"       // for CodeLocation
    23 #include "GenPoly/DeclMutator.h"  // for DeclMutator
    24 #include "InitTweak/InitTweak.h"  // for getFunction
    25 #include "Parser/LinkageSpec.h"   // for Spec, C, Intrinsic
    26 #include "SynTree/Constant.h"     // for Constant
    27 #include "SynTree/Declaration.h"  // for StructDecl, DeclarationWithType
    28 #include "SynTree/Expression.h"   // for UntypedMemberExpr, Expression, Uniq...
    29 #include "SynTree/Label.h"        // for operator==, Label
    30 #include "SynTree/Mutator.h"      // for Mutator
    31 #include "SynTree/Type.h"         // for Type, Type::Qualifiers, TupleType
    32 #include "SynTree/Visitor.h"      // for Visitor
    33 
    34 class CompoundStmt;
    35 class TypeSubstitution;
     16#include <iterator>
     17#include <iostream>
     18#include <cassert>
     19#include "Tuples.h"
     20#include "Common/PassVisitor.h"
     21#include "Common/ScopedMap.h"
     22#include "GenPoly/DeclMutator.h"
     23#include "InitTweak/GenInit.h"
     24#include "InitTweak/InitTweak.h"
     25#include "ResolvExpr/typeops.h"
     26#include "SymTab/Mangler.h"
     27#include "SynTree/Declaration.h"
     28#include "SynTree/Expression.h"
     29#include "SynTree/Initializer.h"
     30#include "SynTree/Mutator.h"
     31#include "SynTree/Statement.h"
     32#include "SynTree/Type.h"
    3633
    3734namespace Tuples {
  • src/Virtual/ExpandCasts.cc

    r6ac5223 r97e3296  
    1515
    1616#include "ExpandCasts.h"
    17 
    18 #include <cassert>                 // for assert, assertf
    19 #include <iterator>                // for back_inserter, inserter
    20 #include <map>                     // for map, _Rb_tree_iterator, map<>::ite...
    21 #include <string>                  // for string, allocator, operator==, ope...
    22 #include <utility>                 // for pair
    23 
    24 #include "Common/PassVisitor.h"    // for PassVisitor
    25 #include "Common/SemanticError.h"  // for SemanticError
    26 #include "SynTree/Declaration.h"   // for ObjectDecl, StructDecl, FunctionDecl
    27 #include "SynTree/Expression.h"    // for VirtualCastExpr, CastExpr, Address...
    28 #include "SynTree/Mutator.h"       // for mutateAll
    29 #include "SynTree/Type.h"          // for Type, PointerType, StructInstType
    30 #include "SynTree/Visitor.h"       // for acceptAll
     17#include "Common/PassVisitor.h"
    3118
    3219namespace Virtual {
  • src/Virtual/ExpandCasts.h

    r6ac5223 r97e3296  
    1616#pragma once
    1717
    18 #include <list>  // for list
    19 
    20 class Declaration;
     18#include <list>
     19#include "SynTree/SynTree.h"
    2120
    2221namespace Virtual {
  • src/main.cc

    r6ac5223 r97e3296  
    1515//
    1616
     17#include <cassert>                          // for assertf
    1718#include <cxxabi.h>                         // for __cxa_demangle
    1819#include <execinfo.h>                       // for backtrace, backtrace_symbols
    1920#include <getopt.h>                         // for no_argument, optind, geto...
    2021#include <signal.h>                         // for signal, SIGABRT, SIGSEGV
    21 #include <cassert>                          // for assertf
    2222#include <cstdio>                           // for fopen, FILE, fclose, stdin
    2323#include <cstdlib>                          // for exit, free, abort, EXIT_F...
     
    2727#include <iterator>                         // for back_inserter
    2828#include <list>                             // for list
    29 #include <string>                           // for char_traits, operator<<
     29#include <string>                           // for operator<<, allocator
    3030
    3131#include "../config.h"                      // for CFA_LIBDIR
  • src/tests/except-0.c

    r6ac5223 r97e3296  
    11// Draft of tests for exception handling.
    2 // Outdated: The integer constant exceptions need to be replaced with virtual
    3 // exceptions for the new system.
    42
    53// ERROR: exceptions do not interact with ^?{} properly.
  • src/tests/except-1.c

    r6ac5223 r97e3296  
    11// Draft memory management test. (remember -fexceptions)
    2 // Outdated: The integer constant exceptions need to be replaced with virtual
    3 // exceptions for the new system.
    42
    53#include <stdio.h>
  • src/tests/except-2.c

    r6ac5223 r97e3296  
    8080}
    8181num_error_vtable _num_error_vtable_instance @= {
    82         &INSTANCE(BASE_EXCEPT),
     82        &___cfaehm__base_exception_t_vtable_instance,
    8383        sizeof(num_error), ?{}, ^?{},
    8484        num_error_msg, num_error_code
     
    9191                yin black;
    9292                throw (BASE_EXCEPT *)&black;
    93         } catch ( yin * error ) {
     93        } catch( yin * error ) {
    9494                printf("throw yin caught.\n");
    9595        }
     
    9999                throwResume (BASE_EXCEPT *)&white;
    100100                printf("> throwResume returned.\n");
    101         } catchResume ( yang * error ) {
     101        } catchResume( yang * error ) {
    102102                printf("throwResume yang caught <");
    103103        }
    104104
     105        /* Conditional catches are still a work in progress.
    105106        try {
    106107                num_error x = { 2 };
    107                 throw (BASE_EXCEPT *)&x;
     108                throw (struct exception_t *)&x;
    108109        }
    109         catch (num_error * error ; 3 == error->virtual_table->code( error ) ) {
    110                 printf("exception at %p\n", error );
     110        catch (num_error * error0 ; 3 == error0->virtual_table->code( error0 ) ) {
     111                printf("exception at %p\n", error0 );
    111112                printf("Should not be printed.\n");
    112113        }
    113         catch (num_error * error ; 2 == error->virtual_table->code( error ) ) {
     114        catch (num_error * error1 ; 2 == error1->virtual_table->code( error1 ) ) {
    114115                printf("Should be printed.\n");
    115         }
     116        }*/
    116117}
    117118
Note: See TracChangeset for help on using the changeset viewer.