Changeset 9236060 for src/SymTab


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

Merge branch 'master' into references

Location:
src/SymTab
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/AddVisit.h

    rfd344aa r9236060  
    1414//
    1515
     16#include "SynTree/Statement.h"
     17
    1618namespace SymTab {
    1719        void addDecls( std::list< Declaration* > &declsToAdd, std::list< Statement* > &statements, std::list< Statement* >::iterator i );
     
    2830
    2931                        if ( stmt == stmts.end() ) break;
    30                        
     32
    3133                        // run mutator on statement
    3234                        maybeAccept( *stmt, visitor );
     
    5961
    6062                        if ( decl == translationUnit.end() ) break;
    61                        
     63
    6264                        // run mutator on declaration
    6365                        maybeAccept( *decl, visitor );
  • src/SymTab/Autogen.cc

    rfd344aa r9236060  
    1010// Created On       : Thu Mar 03 15:45:56 2016
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jun 28 15:30:00 2017
    13 // Update Count     : 61
     12// Last Modified On : Fri Jul 14 16:41:00 2017
     13// Update Count     : 62
    1414//
    1515
    16 #include <list>
    17 #include <iterator>
    18 #include "SynTree/Visitor.h"
    19 #include "SynTree/Attribute.h"
    20 #include "SynTree/Type.h"
    21 #include "SynTree/Statement.h"
    22 #include "SynTree/TypeSubstitution.h"
    23 #include "Common/utility.h"
    24 #include "CodeGen/OperatorTable.h"
    25 #include "AddVisit.h"
    26 #include "MakeLibCfa.h"
    2716#include "Autogen.h"
    28 #include "GenPoly/ScopedSet.h"
    29 #include "Common/ScopedMap.h"
    30 #include "SymTab/Mangler.h"
    31 #include "GenPoly/DeclMutator.h"
     17
     18#include <algorithm>               // for count_if
     19#include <cassert>                 // for safe_dynamic_cast, assert, assertf
     20#include <iterator>                // for back_insert_iterator, back_inserter
     21#include <list>                    // for list, _List_iterator, list<>::iter...
     22#include <set>                     // for set, _Rb_tree_const_iterator
     23#include <vector>                  // for vector
     24
     25#include "AddVisit.h"              // for addVisit
     26#include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign
     27#include "Common/ScopedMap.h"      // for ScopedMap<>::const_iterator, Scope...
     28#include "Common/utility.h"        // for cloneAll, operator+
     29#include "GenPoly/DeclMutator.h"   // for DeclMutator
     30#include "GenPoly/ScopedSet.h"     // for ScopedSet, ScopedSet<>::iterator
     31#include "SymTab/Mangler.h"        // for Mangler
     32#include "SynTree/Attribute.h"     // For Attribute
     33#include "SynTree/Mutator.h"       // for maybeMutate
     34#include "SynTree/Statement.h"     // for CompoundStmt, ReturnStmt, ExprStmt
     35#include "SynTree/Type.h"          // for FunctionType, Type, TypeInstType
     36#include "SynTree/Visitor.h"       // for maybeAccept, Visitor, acceptAll
     37
     38class Attribute;
    3239
    3340namespace SymTab {
     
    396403        void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) {
    397404                // Builtins do not use autogeneration.
    398                 if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin ||
     405                if ( aggregateDecl->get_linkage() == LinkageSpec::BuiltinCFA ||
    399406                         aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) {
    400407                        return;
  • src/SymTab/Autogen.h

    rfd344aa r9236060  
    1010// Created On       : Sun May 17 21:53:34 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun 21 17:25:26 2017
    13 // Update Count     : 14
     12// Last Modified On : Sat Jul 22 09:50:25 2017
     13// Update Count     : 15
    1414//
    1515
    16 #ifndef AUTOGEN_H
    17 #define AUTOGEN_H
     16#pragma once
    1817
    19 #include <string>
    20 #include "SynTree/Statement.h"
    21 #include "SynTree/Expression.h"
    22 #include "SynTree/Declaration.h"
    23 #include "SynTree/Initializer.h"
    24 #include "InitTweak/InitTweak.h"
     18#include <cassert>                // for assert
     19#include <iterator>               // for back_insert_iterator, back_inserter
     20#include <list>                   // for list
     21#include <string>                 // for string, operator==
     22
     23#include "Common/UniqueName.h"    // for UniqueName
     24#include "InitTweak/InitTweak.h"  // for InitExpander
     25#include "Parser/LinkageSpec.h"   // for C
     26#include "SynTree/Constant.h"     // for Constant
     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
     32#include "SynTree/Type.h"         // for Type, ArrayType, Type::Qualifiers
    2533
    2634namespace SymTab {
     
    160168                if ( isUnnamedBitfield( obj ) ) return;
    161169
    162                 bool addCast = (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && obj->get_bitfieldWidth() == NULL ) );
     170                bool addCast = (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && ! obj->get_bitfieldWidth() ) );
    163171                std::list< Statement * > stmts;
    164172                genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj->get_type(), addCast, forward );
     
    179187        }
    180188} // namespace SymTab
    181 #endif // AUTOGEN_H
     189
     190// Local Variables: //
     191// tab-width: 4 //
     192// mode: c++ //
     193// compile-command: "make install" //
     194// End: //
     195
  • src/SymTab/FixFunction.cc

    rfd344aa r9236060  
    1515
    1616#include "FixFunction.h"
    17 #include "SynTree/Declaration.h"
    18 #include "SynTree/Type.h"
    19 #include "SynTree/Expression.h"
    20 #include "Common/utility.h"
     17
     18#include <list>                   // for list
     19
     20#include "Common/utility.h"       // for maybeClone
     21#include "SynTree/Declaration.h"  // for FunctionDecl, ObjectDecl, Declarati...
     22#include "SynTree/Type.h"         // for ArrayType, PointerType, Type, Basic...
    2123
    2224namespace SymTab {
  • src/SymTab/FixFunction.h

    rfd344aa r9236060  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixFunction.h -- 
     7// FixFunction.h --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 17:02:08 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:34:06 2016
    13 // Update Count     : 3
     12// Last Modified On : Sat Jul 22 09:45:55 2017
     13// Update Count     : 4
    1414//
    1515
    16 #ifndef FIXFUNCTION_H
    17 #define FIXFUNCTION_H
     16#pragma once
    1817
    19 #include "SynTree/Mutator.h"
     18#include "SynTree/Mutator.h"  // for Mutator
     19#include "SynTree/SynTree.h"  // for Types
    2020
    2121namespace SymTab {
     
    4444                virtual Type* mutate(ZeroType *zeroType);
    4545                virtual Type* mutate(OneType *oneType);
    46  
     46
    4747                bool isVoid;
    4848        };
    4949} // namespace SymTab
    50 
    51 #endif // FIXFUNCTION_H
    5250
    5351// Local Variables: //
  • src/SymTab/ImplementationType.cc

    rfd344aa r9236060  
    1515
    1616#include "ImplementationType.h"
    17 #include "SynTree/Type.h"
    18 #include "SynTree/Declaration.h"
    19 #include "SynTree/Visitor.h"
    20 #include "SymTab/Indexer.h"
    21 #include "Common/utility.h"
     17
     18#include <list>                   // for list, _List_iterator, list<>::iterator
     19
     20#include "SymTab/Indexer.h"       // for Indexer
     21#include "SynTree/Declaration.h"  // for NamedTypeDecl
     22#include "SynTree/Type.h"         // for TupleType, Type, ArrayType, Pointer...
     23#include "SynTree/Visitor.h"      // for Visitor
    2224
    2325
  • src/SymTab/ImplementationType.h

    rfd344aa r9236060  
    1010// Created On       : Sun May 17 21:35:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun May 17 21:37:15 2015
    13 // Update Count     : 2
     12// Last Modified On : Sat Jul 22 09:46:19 2017
     13// Update Count     : 3
    1414//
    1515
    16 #ifndef IMPLEMENTATIONTYPE_H
    17 #define IMPLEMENTATIONTYPE_H
     16#pragma once
    1817
    19 #include "SynTree/SynTree.h"
    20 #include "SymTab/Indexer.h"
     18class Type;
    2119
    2220namespace SymTab {
     21class Indexer;
     22
    2323        Type *implementationType( Type *, const SymTab::Indexer &indexer );
    2424
     
    3131} // namespace SymTab
    3232
    33 #endif // IMPLEMENTATIONTYPE_H
    34 
    3533// Local Variables: //
    3634// tab-width: 4 //
  • src/SymTab/Indexer.cc

    rfd344aa r9236060  
    1616#include "Indexer.h"
    1717
    18 #include <string>
    19 #include <typeinfo>
    20 #include <unordered_map>
    21 #include <unordered_set>
    22 #include <utility>
    23 #include <algorithm>
    24 
    25 #include "Mangler.h"
    26 
    27 #include "Common/utility.h"
    28 
    29 #include "CodeGen/OperatorTable.h"
    30 
    31 #include "ResolvExpr/typeops.h"
    32 
    33 #include "SynTree/Declaration.h"
    34 #include "SynTree/Type.h"
    35 #include "SynTree/Expression.h"
    36 #include "SynTree/Initializer.h"
    37 #include "SynTree/Statement.h"
    38 
    39 #include "InitTweak/InitTweak.h"
     18#include <cassert>                 // for assert, safe_dynamic_cast
     19#include <iostream>                // for operator<<, basic_ostream, ostream
     20#include <string>                  // for string, operator<<, operator!=
     21#include <unordered_map>           // for operator!=, unordered_map<>::const...
     22#include <unordered_set>           // for unordered_set
     23#include <utility>                 // for pair, make_pair, move
     24
     25#include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign
     26#include "Common/SemanticError.h"  // for SemanticError
     27#include "Common/utility.h"        // for cloneAll
     28#include "InitTweak/InitTweak.h"   // for isConstructor, isCopyFunction, isC...
     29#include "Mangler.h"               // for Mangler
     30#include "Parser/LinkageSpec.h"    // for isMangled, isOverridable, Spec
     31#include "ResolvExpr/typeops.h"    // for typesCompatible
     32#include "SynTree/Constant.h"      // for Constant
     33#include "SynTree/Declaration.h"   // for DeclarationWithType, FunctionDecl
     34#include "SynTree/Expression.h"    // for Expression, ImplicitCopyCtorExpr
     35#include "SynTree/Initializer.h"   // for Initializer
     36#include "SynTree/Statement.h"     // for CompoundStmt, Statement, ForStmt (...
     37#include "SynTree/Type.h"          // for Type, StructInstType, UnionInstType
    4038
    4139#define debugPrint(x) if ( doDebug ) { std::cout << x; }
  • src/SymTab/Indexer.h

    rfd344aa r9236060  
    1010// Created On       : Sun May 17 21:38:55 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:34:14 2016
    13 // Update Count     : 6
     12// Last Modified On : Sat Jul 22 09:46:34 2017
     13// Update Count     : 7
    1414//
    1515
    16 #ifndef INDEXER_H
    17 #define INDEXER_H
     16#pragma once
    1817
    19 #include <list>
    20 #include <string>
     18#include <iosfwd>             // for ostream
     19#include <list>               // for list
     20#include <string>             // for string
    2121
    22 #include "SynTree/Visitor.h"
     22#include "SynTree/Visitor.h"  // for Visitor
     23#include "SynTree/SynTree.h"  // for AST nodes
    2324
    2425namespace SymTab {
     
    126127
    127128                struct Impl;
     129
    128130                Impl *tables;         ///< Copy-on-write instance of table data structure
    129131                unsigned long scope;  ///< Scope index of this pointer
     
    145147} // namespace SymTab
    146148
    147 #endif // INDEXER_H
    148 
    149149// Local Variables: //
    150150// tab-width: 4 //
  • src/SymTab/Mangler.cc

    rfd344aa r9236060  
    1313// Update Count     : 21
    1414//
    15 
    16 #include <cassert>
    17 #include <string>
    18 #include <algorithm>
    19 #include <iterator>
    20 #include <functional>
    21 #include <set>
    22 
    23 #include "SynTree/Declaration.h"
    24 #include "SynTree/Type.h"
    25 #include "SynTree/Expression.h"
    26 #include "SynTree/Initializer.h"
    27 #include "SynTree/Statement.h"
    2815#include "Mangler.h"
    29 #include "CodeGen/OperatorTable.h"
     16
     17#include <algorithm>                // for copy, transform
     18#include <cassert>                  // for assert, assertf
     19#include <functional>               // for const_mem_fun_t, mem_fun
     20#include <iterator>                 // for ostream_iterator, back_insert_ite...
     21#include <list>                     // for _List_iterator, list, _List_const...
     22#include <string>                   // for string, operator<<, basic_string
     23
     24#include "CodeGen/OperatorTable.h"  // for OperatorInfo, operatorLookup
     25#include "Common/utility.h"         // for toString
     26#include "Parser/LinkageSpec.h"     // for Spec, isOverridable, AutoGen, Int...
     27#include "SynTree/Declaration.h"    // for TypeDecl, DeclarationWithType
     28#include "SynTree/Expression.h"     // for TypeExpr, Expression, operator<<
     29#include "SynTree/Type.h"           // for Type, ReferenceToType, Type::Fora...
    3030
    3131namespace SymTab {
  • src/SymTab/Mangler.h

    rfd344aa r9236060  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:44:03 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 19 15:48:46 2015
    13 // Update Count     : 14
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sat Jul 22 09:45:30 2017
     13// Update Count     : 15
    1414//
    1515
    16 #ifndef MANGLER_H
    17 #define MANGLER_H
     16#pragma once
    1817
    19 #include <sstream>
    20 #include "SynTree/SynTree.h"
    21 #include "SynTree/Visitor.h"
     18#include <map>                // for map, map<>::value_compare
     19#include <sstream>            // for ostringstream
     20#include <string>             // for string
     21#include <utility>            // for pair
     22
     23#include "SynTree/SynTree.h"  // for Types
     24#include "SynTree/Visitor.h"  // for Visitor, maybeAccept
    2225
    2326namespace SymTab {
     
    7881} // SymTab
    7982
    80 #endif // MANGLER_H
    81 
    8283// Local Variables: //
    8384// tab-width: 4 //
  • src/SymTab/TypeEquality.cc

    rfd344aa r9236060  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // TypeEquality.cc -- 
     7// TypeEquality.cc --
    88//
    99// Author           : Rob Schluntz
     
    1313// Update Count     : 37
    1414//
    15 
    16 #include <list>
    17 #include <iterator>
    18 #include "Validate.h"
    19 #include "SynTree/Visitor.h"
    20 #include "SynTree/Type.h"
    21 #include "SynTree/Statement.h"
    22 #include "SynTree/TypeSubstitution.h"
    23 #include "Indexer.h"
    2415#include "TypeEquality.h"
     16
     17#include <cassert>                // for assert
     18#include <list>                   // for list, list<>::iterator, _List_iterator
     19#include <string>                 // for operator==, string, basic_string
     20
     21#include "SynTree/Constant.h"     // for Constant
     22#include "SynTree/Declaration.h"  // for DeclarationWithType
     23#include "SynTree/Expression.h"   // for ConstantExpr, Expression
     24#include "SynTree/Type.h"         // for Type, ArrayType, FunctionType, Enum...
     25#include "SynTree/Visitor.h"      // for Visitor
    2526
    2627namespace SymTab {
    2728        class TypeEquality : public Visitor {
    2829  public:
    29                 TypeEquality( Type * other, bool vlaErr ) : result( true ), other( other ), 
     30                TypeEquality( Type * other, bool vlaErr ) : result( true ), other( other ),
    3031                        vlaErr( vlaErr ) {}
    3132                bool result;
     
    7172                handleQualifiers( basicType );
    7273                if ( BasicType * bt = dynamic_cast< BasicType * >( other ) ) {
    73                         result = result && basicType->get_kind() == bt->get_kind(); 
     74                        result = result && basicType->get_kind() == bt->get_kind();
    7475                } else {
    7576                        result = false;
     
    9899
    99100                        if ( vlaErr ) {
    100                                 // useful for comparing typedef types - in this case, we 
     101                                // useful for comparing typedef types - in this case, we
    101102                                // want types to appear distinct if either is a VLA type
    102103                                if ( arrayType->get_isVarLen() || at->get_isVarLen() ) {
     
    146147
    147148                        // parameter types must be equivalent
    148                         it1 = funcType->get_parameters().begin(); 
     149                        it1 = funcType->get_parameters().begin();
    149150                        it2 = ft->get_parameters().begin();
    150151                        for ( ; it1 != funcType->get_parameters().end(); ++it1, ++it2 ) {
  • src/SymTab/TypeEquality.h

    rfd344aa r9236060  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // TypeEquality.h -- 
     7// TypeEquality.h --
    88//
    99// Author           : Rob Schluntz
     
    1414//
    1515
     16class Type;
     17
    1618namespace SymTab {
    1719  // compare types t1 and t2 for equality
    18   // if vlaErr is true, then if at least one of the types is a 
    19   // variable-length array type, then the result will be false 
     20  // if vlaErr is true, then if at least one of the types is a
     21  // variable-length array type, then the result will be false
    2022  bool typeEquals( Type * t1, Type * t2, bool vlaErr = false );
    2123} // namespace SymTab
  • src/SymTab/Validate.cc

    rfd344aa r9236060  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:50:04 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 30 16:50:13 2017
    13 // Update Count     : 357
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tus Aug  8 13:27:00 2017
     13// Update Count     : 358
    1414//
    1515
     
    3838//   definition occurs later in the input.
    3939
    40 #include <algorithm>
    41 #include <iterator>
    42 #include <list>
    43 
    44 #include "CodeGen/CodeGenerator.h"
    45 #include "CodeGen/OperatorTable.h"
    46 
    47 #include "Common/PassVisitor.h"
    48 #include "Common/ScopedMap.h"
    49 #include "Common/UniqueName.h"
    50 #include "Common/utility.h"
    51 
    52 #include "Concurrency/Keywords.h"
    53 
    54 #include "GenPoly/DeclMutator.h"
    55 
    56 #include "AddVisit.h"
    57 #include "Autogen.h"
    58 #include "FixFunction.h"
    59 // #include "ImplementationType.h"
    60 #include "Indexer.h"
    61 #include "MakeLibCfa.h"
    62 #include "TypeEquality.h"
    6340#include "Validate.h"
    6441
    65 #include "ResolvExpr/typeops.h"
    66 
    67 #include "SynTree/Attribute.h"
    68 #include "SynTree/Expression.h"
    69 #include "SynTree/Mutator.h"
    70 #include "SynTree/Statement.h"
    71 #include "SynTree/Type.h"
    72 #include "SynTree/TypeSubstitution.h"
    73 #include "SynTree/Visitor.h"
     42#include <cstddef>                     // for size_t
     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
     55#include "CodeGen/CodeGenerator.h"     // for genName
     56#include "CodeGen/OperatorTable.h"     // for isCtorDtor, isCtorDtorAssign
     57#include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
     58#include "Common/ScopedMap.h"          // for ScopedMap<>::const_iterator
     59#include "Common/SemanticError.h"      // for SemanticError
     60#include "Common/UniqueName.h"         // for UniqueName
     61#include "Common/utility.h"            // for operator+, cloneAll, deleteAll
     62#include "Concurrency/Keywords.h"      // for applyKeywords, implementMutexF...
     63#include "FixFunction.h"               // for FixFunction
     64#include "Indexer.h"                   // for Indexer
     65#include "InitTweak/InitTweak.h"       // for isCtorDtor, isCtorDtorAssign
     66#include "Parser/LinkageSpec.h"        // for C, Cforall
     67#include "ResolvExpr/typeops.h"        // for extractResultType, typesCompat...
     68#include "SynTree/Attribute.h"         // for Attribute
     69#include "SynTree/Constant.h"          // for Constant
     70#include "SynTree/Declaration.h"       // for EnumDecl, StructDecl, UnionDecl
     71#include "SynTree/Expression.h"        // for TypeExpr, CompoundLiteralExpr
     72#include "SynTree/Initializer.h"       // for ListInit, Initializer, noDesig...
     73#include "SynTree/Mutator.h"           // for mutateAll, Mutator
     74#include "SynTree/Statement.h"         // for CompoundStmt, DeclStmt, Return...
     75#include "SynTree/Type.h"              // for Type, TypeInstType, TraitInstType
     76#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution, applySubstit...
     77#include "SynTree/Visitor.h"           // for acceptAll, Visitor
    7478
    7579#define debugPrint( x ) if ( doDebug ) { std::cout << x; }
     
    612616                // a return statement in a void-returning function in C. The expression is treated as if it
    613617                // were cast to void.
    614                 if ( returnStmt->get_expr() == NULL && returnVals.size() != 0 ) {
     618                if ( ! returnStmt->get_expr() && returnVals.size() != 0 ) {
    615619                        throw SemanticError( "Non-void function returns no values: " , returnStmt );
    616620                }
     
    691695                Type *designatorType = tyDecl->get_base()->stripDeclarator();
    692696                if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( designatorType ) ) {
    693                         return new StructDecl( aggDecl->get_name() );
     697                        return new StructDecl( aggDecl->get_name(), DeclarationNode::Struct, noAttributes, tyDecl->get_linkage() );
    694698                } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( designatorType ) ) {
    695                         return new UnionDecl( aggDecl->get_name() );
     699                        return new UnionDecl( aggDecl->get_name(), noAttributes, tyDecl->get_linkage() );
    696700                } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( designatorType ) ) {
    697                         return new EnumDecl( enumDecl->get_name() );
     701                        return new EnumDecl( enumDecl->get_name(), noAttributes, tyDecl->get_linkage() );
    698702                } else {
    699703                        return ret->clone();
     
    788792                                type = new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() );
    789793                        } // if
    790                         TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), Type::StorageClasses(), type ) );
     794                        TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), Type::StorageClasses(), type, aggDecl->get_linkage() ) );
    791795                        typedefNames[ aggDecl->get_name() ] = std::make_pair( std::move( tyDecl ), scopeLevel );
    792796                } // if
     
    843847        void validateGeneric( Aggr * inst ) {
    844848                std::list< TypeDecl * > * params = inst->get_baseParameters();
    845                 if ( params != NULL ) {
     849                if ( params ) {
    846850                        std::list< Expression * > & args = inst->get_parameters();
    847851
     
    908912                FunctionType * ftype = functionDecl->get_functionType();
    909913                std::list< DeclarationWithType * > & retVals = ftype->get_returnVals();
    910                 assertf( retVals.size() == 0 || retVals.size() == 1, "Function %s has too many return values: %d", functionDecl->get_name().c_str(), retVals.size() );
     914                assertf( retVals.size() == 0 || retVals.size() == 1, "Function %s has too many return values: %zu", functionDecl->get_name().c_str(), retVals.size() );
    911915                if ( retVals.size() == 1 ) {
    912916                        // ensure all function return values have a name - use the name of the function to disambiguate (this also provides a nice bit of help for debugging).
     
    944948        void ArrayLength::previsit( ObjectDecl * objDecl ) {
    945949                if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->get_type() ) ) {
    946                         if ( at->get_dimension() != nullptr ) return;
     950                        if ( at->get_dimension() ) return;
    947951                        if ( ListInit * init = dynamic_cast< ListInit * >( objDecl->get_init() ) ) {
    948952                                at->set_dimension( new ConstantExpr( Constant::from_ulong( init->get_initializers().size() ) ) );
  • src/SymTab/Validate.h

    rfd344aa r9236060  
    1111// Created On       : Sun May 17 21:53:34 2015
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Tue May 19 16:49:43 2015
    14 // Update Count     : 3
     13// Last Modified On : Sat Jul 22 09:46:07 2017
     14// Update Count     : 4
    1515//
    1616
    17 #ifndef VALIDATE_H
    18 #define VALIDATE_H
     17#pragma once
    1918
    20 #include "SynTree/SynTree.h"
     19#include <list>  // for list
     20
     21class Declaration;
     22class Type;
    2123
    2224namespace SymTab {
     
    2830} // namespace SymTab
    2931
    30 #endif // VALIDATE_H
    31 
    3232// Local Variables: //
    3333// tab-width: 4 //
  • src/SymTab/module.mk

    rfd344aa r9236060  
    1010## Author           : Richard C. Bilson
    1111## Created On       : Mon Jun  1 17:49:17 2015
    12 ## Last Modified By : Rob Schluntz
    13 ## Last Modified On : Tue Jul 07 16:22:23 2015
    14 ## Update Count     : 2
     12## Last Modified By : Andrew Beach
     13## Last Modified On : Thr Aug 10 16:08:00 2017
     14## Update Count     : 4
    1515###############################################################################
    1616
Note: See TracChangeset for help on using the changeset viewer.