Changeset f22b170b
- Timestamp:
- Nov 16, 2023, 9:22:34 AM (13 months ago)
- Branches:
- master
- Children:
- aad677d
- Parents:
- 89a8bab (diff), b8b5535 (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. - Location:
- src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Iterate.hpp
r89a8bab rf22b170b 58 58 template<typename val_t> 59 59 struct value_t { 60 size_t idx; 60 61 val_t & val; 61 size_t idx;62 62 }; 63 63 … … 69 69 iterator_t( iter_t _it, size_t _idx ) : it(_it), idx(_idx) {} 70 70 71 value_t<val_t> operator*() const { return value_t<val_t>{ *it, idx}; }71 value_t<val_t> operator*() const { return value_t<val_t>{ idx, *it }; } 72 72 73 73 bool operator==(const iterator_t & o) const { return o.it == it; } -
src/Concurrency/WaitforNew.cpp
r89a8bab rf22b170b 450 450 ); 451 451 452 // For some reason, enumerate doesn't work here because of references. 453 for ( size_t i = 0 ; i < waitfor->clauses.size() ; ++i ) { 452 for ( const auto & [i, clause] : enumerate( waitfor->clauses ) ) { 454 453 theSwitch->cases.push_back( 455 454 new ast::CaseClause( location, … … 457 456 { 458 457 new ast::CompoundStmt( location, { 459 waitfor->clauses[i]->stmt,458 clause->stmt, 460 459 new ast::BranchStmt( location, 461 460 ast::BranchStmt::Break, … … 538 537 ast::Stmt * setter = makeSetter( location, flag ); 539 538 540 // For some reason, enumerate doesn't work here because of references. 541 for ( size_t i = 0 ; i < stmt->clauses.size() ; ++i ) { 542 init_clause( comp, acceptables, i, stmt->clauses[i], setter ); 539 for ( const auto & [i, clause] : enumerate( stmt->clauses ) ) { 540 init_clause( comp, acceptables, i, clause, setter ); 543 541 } 544 542 -
src/GenPoly/Box.h
r89a8bab rf22b170b 16 16 #pragma once 17 17 18 #include <list> // for list19 20 class Declaration;21 18 namespace ast { 22 19 class TranslationUnit; … … 24 21 25 22 namespace GenPoly { 26 /// boxes polymorphic function calls 27 void box( std::list< Declaration* >& translationUnit ); 23 28 24 void box( ast::TranslationUnit & translationUnit ); 25 29 26 } // namespace GenPoly 30 27 -
src/GenPoly/ErasableScopedMap.h
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ErasableScopedMap.h -- 7 // ErasableScopedMap.h -- A map that supports scoping and erasing elements. 8 8 // 9 9 // Author : Aaron B. Moss -
src/GenPoly/FindFunction.cc
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FindFunction.cc -- 7 // FindFunction.cc -- Find function types in a larger type. 8 8 // 9 9 // Author : Richard C. Bilson … … 69 69 GuardScope( typeVars ); 70 70 handleForall( type->forall ); 71 //ast::accept_all( type->returns, *visitor );72 // This might have to become ast::mutate_each with return.73 71 ast::accept_each( type->returns, *visitor ); 74 72 } … … 79 77 functions.push_back( type ); 80 78 if ( replaceMode ) { 81 // replace type parameters in function type with void*79 // Replace type parameters in function type with void *. 82 80 ret = scrubTypeVars( ast::deepCopy( type ), typeVars ); 83 81 } // if -
src/GenPoly/FindFunction.h
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FindFunction.h -- 7 // FindFunction.h -- Find function types in a larger type. 8 8 // 9 9 // Author : Richard C. Bilson … … 16 16 #pragma once 17 17 18 #include "GenPoly.h" // for TyVarMap18 #include "GenPoly.h" // for TypeVarMap 19 19 20 20 namespace GenPoly { -
src/GenPoly/GenPoly.cc
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // GenPoly.cc -- 7 // GenPoly.cc -- General GenPoly utilities. 8 8 // 9 9 // Author : Richard C. Bilson … … 33 33 34 34 namespace GenPoly { 35 namespace { 36 /// Checks a parameter list for polymorphic parameters; will substitute according to env if present 37 bool hasPolyParams( const std::vector<ast::ptr<ast::Expr>> & params, const ast::TypeSubstitution * env ) { 38 for ( auto ¶m : params ) { 39 auto paramType = param.as<ast::TypeExpr>(); 40 assertf( paramType, "Aggregate parameters should be type expressions" ); 41 if ( isPolyType( paramType->type, env ) ) return true; 35 36 namespace { 37 /// Checks a parameter list for polymorphic parameters; will substitute according to env if present. 38 bool hasPolyParams( const std::vector<ast::ptr<ast::Expr>> & params, const ast::TypeSubstitution * env ) { 39 for ( auto & param : params ) { 40 auto paramType = param.as<ast::TypeExpr>(); 41 assertf( paramType, "Aggregate parameters should be type expressions" ); 42 if ( isPolyType( paramType->type, env ) ) return true; 43 } 44 return false; 45 } 46 47 /// Checks a parameter list for polymorphic parameters from typeVars; will substitute according to env if present. 48 bool hasPolyParams( const std::vector<ast::ptr<ast::Expr>> & params, const TypeVarMap & typeVars, const ast::TypeSubstitution * env ) { 49 for ( auto & param : params ) { 50 auto paramType = param.as<ast::TypeExpr>(); 51 assertf( paramType, "Aggregate parameters should be type expressions" ); 52 if ( isPolyType( paramType->type, typeVars, env ) ) return true; 53 } 54 return false; 55 } 56 57 /// Checks a parameter list for dynamic-layout parameters from tyVars; will substitute according to env if present. 58 bool hasDynParams( 59 const std::vector<ast::ptr<ast::Expr>> & params, 60 const TypeVarMap & typeVars, 61 const ast::TypeSubstitution * subst ) { 62 for ( ast::ptr<ast::Expr> const & paramExpr : params ) { 63 auto param = paramExpr.as<ast::TypeExpr>(); 64 assertf( param, "Aggregate parameters should be type expressions." ); 65 if ( isDynType( param->type.get(), typeVars, subst ) ) { 66 return true; 42 67 } 43 return false; 44 } 45 46 /// Checks a parameter list for polymorphic parameters from tyVars; will substitute according to env if present 47 bool hasPolyParams( const std::vector<ast::ptr<ast::Expr>> & params, const TypeVarMap & typeVars, const ast::TypeSubstitution * env ) { 48 for ( auto & param : params ) { 49 auto paramType = param.as<ast::TypeExpr>(); 50 assertf( paramType, "Aggregate parameters should be type expressions" ); 51 if ( isPolyType( paramType->type, typeVars, env ) ) return true; 52 } 53 return false; 54 } 55 56 /// Checks a parameter list for dynamic-layout parameters from tyVars; will substitute according to env if present 57 bool hasDynParams( 58 const std::vector<ast::ptr<ast::Expr>> & params, 59 const TypeVarMap & typeVars, 60 const ast::TypeSubstitution * subst ) { 61 for ( ast::ptr<ast::Expr> const & paramExpr : params ) { 62 auto param = paramExpr.as<ast::TypeExpr>(); 63 assertf( param, "Aggregate parameters should be type expressions." ); 64 if ( isDynType( param->type.get(), typeVars, subst ) ) { 65 return true; 66 } 67 } 68 return false; 69 } 70 } 71 72 const ast::Type * replaceTypeInst(const ast::Type * type, const ast::TypeSubstitution * env) { 73 if (!env) return type; 74 if ( auto typeInst = dynamic_cast<const ast::TypeInstType*>(type) ) { 75 auto newType = env->lookup(typeInst); 76 if (newType) return newType; 77 } 68 } 69 return false; 70 } 71 } // namespace 72 73 const ast::Type * replaceTypeInst( const ast::Type * type, const ast::TypeSubstitution * env ) { 74 if ( !env ) return type; 75 if ( auto typeInst = dynamic_cast<const ast::TypeInstType*>( type ) ) { 76 if ( auto newType = env->lookup( typeInst ) ) return newType; 77 } 78 return type; 79 } 80 81 const ast::Type * isPolyType( const ast::Type * type, const ast::TypeSubstitution * subst ) { 82 type = replaceTypeInst( type, subst ); 83 84 if ( dynamic_cast< const ast::TypeInstType * >( type ) ) { 85 // This case is where the two variants of isPolyType differ. 78 86 return type; 79 } 80 81 const ast::Type * isPolyType(const ast::Type * type, const ast::TypeSubstitution * env) { 82 type = replaceTypeInst( type, env ); 83 84 if ( dynamic_cast< const ast::TypeInstType * >( type ) ) { 85 return type; 86 } else if ( auto arrayType = dynamic_cast< const ast::ArrayType * >( type ) ) { 87 return isPolyType( arrayType->base, env ); 88 } else if ( auto structType = dynamic_cast< const ast::StructInstType* >( type ) ) { 89 if ( hasPolyParams( structType->params, env ) ) return type; 90 } else if ( auto unionType = dynamic_cast< const ast::UnionInstType* >( type ) ) { 91 if ( hasPolyParams( unionType->params, env ) ) return type; 92 } 93 return 0; 94 } 87 } else if ( auto arrayType = dynamic_cast< const ast::ArrayType * >( type ) ) { 88 return isPolyType( arrayType->base, subst ); 89 } else if ( auto structType = dynamic_cast< const ast::StructInstType* >( type ) ) { 90 if ( hasPolyParams( structType->params, subst ) ) return type; 91 } else if ( auto unionType = dynamic_cast< const ast::UnionInstType* >( type ) ) { 92 if ( hasPolyParams( unionType->params, subst ) ) return type; 93 } 94 return nullptr; 95 } 95 96 96 97 const ast::Type * isPolyType( const ast::Type * type, … … 121 122 } 122 123 } else if ( auto inst = dynamic_cast<ast::StructInstType const *>( type ) ) { 123 if ( hasDynParams( inst->params, typeVars, subst ) ) { 124 return inst; 125 } 124 if ( hasDynParams( inst->params, typeVars, subst ) ) return inst; 126 125 } else if ( auto inst = dynamic_cast<ast::UnionInstType const *>( type ) ) { 127 if ( hasDynParams( inst->params, typeVars, subst ) ) { 128 return inst; 129 } 126 if ( hasDynParams( inst->params, typeVars, subst ) ) return inst; 130 127 } 131 128 return nullptr; … … 190 187 } 191 188 192 const ast::FunctionType * getFunctionType( const ast::Type * ty ) { 193 if ( auto pty = dynamic_cast< const ast::PointerType * >( ty ) ) { 194 return pty->base.as< ast::FunctionType >(); 195 } else { 196 return dynamic_cast< const ast::FunctionType * >( ty ); 197 } 198 } 199 200 namespace { 201 /// Checks if is a pointer to D 202 template<typename D, typename B> 203 bool is( const B* p ) { return type_index{typeid(D)} == type_index{typeid(*p)}; } 204 205 /// Converts to a pointer to D without checking for safety 206 template<typename D, typename B> 207 inline D* as( B* p ) { return reinterpret_cast<D*>(p); } 208 209 template<typename D, typename B> 210 inline D const * as( B const * p ) { 211 return reinterpret_cast<D const *>( p ); 212 } 213 214 /// Flattens a list of types. 215 // There is another flattenList in Unify. 216 void flattenList( vector<ast::ptr<ast::Type>> const & src, 217 vector<ast::ptr<ast::Type>> & out ) { 218 for ( auto const & type : src ) { 219 ResolvExpr::flatten( type, out ); 220 } 221 } 222 223 bool paramListsPolyCompatible( 224 std::vector<ast::ptr<ast::Expr>> const & lparams, 225 std::vector<ast::ptr<ast::Expr>> const & rparams ) { 226 if ( lparams.size() != rparams.size() ) { 189 const ast::FunctionType * getFunctionType( const ast::Type * ty ) { 190 if ( auto pty = dynamic_cast< const ast::PointerType * >( ty ) ) { 191 return pty->base.as< ast::FunctionType >(); 192 } else { 193 return dynamic_cast< const ast::FunctionType * >( ty ); 194 } 195 } 196 197 namespace { 198 /// Checks if is a pointer to D 199 template<typename D, typename B> 200 bool is( const B* p ) { return type_index{typeid(D)} == type_index{typeid(*p)}; } 201 202 /// Converts to a pointer to D without checking for safety 203 template<typename D, typename B> 204 inline D* as( B* p ) { return reinterpret_cast<D*>(p); } 205 206 template<typename D, typename B> 207 inline D const * as( B const * p ) { 208 return reinterpret_cast<D const *>( p ); 209 } 210 211 /// Flattens a list of types. 212 void flattenList( vector<ast::ptr<ast::Type>> const & src, 213 vector<ast::ptr<ast::Type>> & out ) { 214 for ( auto const & type : src ) { 215 ResolvExpr::flatten( type, out ); 216 } 217 } 218 219 bool paramListsPolyCompatible( 220 std::vector<ast::ptr<ast::Expr>> const & lparams, 221 std::vector<ast::ptr<ast::Expr>> const & rparams ) { 222 if ( lparams.size() != rparams.size() ) { 223 return false; 224 } 225 226 for ( auto lparam = lparams.begin(), rparam = rparams.begin() ; 227 lparam != lparams.end() ; ++lparam, ++rparam ) { 228 ast::TypeExpr const * lexpr = lparam->as<ast::TypeExpr>(); 229 assertf( lexpr, "Aggregate parameters should be type expressions" ); 230 ast::TypeExpr const * rexpr = rparam->as<ast::TypeExpr>(); 231 assertf( rexpr, "Aggregate parameters should be type expressions" ); 232 233 // xxx - might need to let VoidType be a wildcard here too; could have some voids 234 // stuffed in for dtype-statics. 235 // if ( is<VoidType>( lexpr->type() ) || is<VoidType>( bparam->get_type() ) ) continue; 236 if ( !typesPolyCompatible( lexpr->type, rexpr->type ) ) { 227 237 return false; 228 238 } 229 230 for ( auto lparam = lparams.begin(), rparam = rparams.begin() ; 231 lparam != lparams.end() ; ++lparam, ++rparam ) { 232 ast::TypeExpr const * lexpr = lparam->as<ast::TypeExpr>(); 233 assertf( lexpr, "Aggregate parameters should be type expressions" ); 234 ast::TypeExpr const * rexpr = rparam->as<ast::TypeExpr>(); 235 assertf( rexpr, "Aggregate parameters should be type expressions" ); 236 237 // xxx - might need to let VoidType be a wildcard here too; could have some voids 238 // stuffed in for dtype-statics. 239 // if ( is<VoidType>( lexpr->type() ) || is<VoidType>( bparam->get_type() ) ) continue; 240 if ( !typesPolyCompatible( lexpr->type, rexpr->type ) ) { 241 return false; 242 } 243 } 244 245 return true; 246 } 247 } 239 } 240 241 return true; 242 } 243 } // namespace 248 244 249 245 bool typesPolyCompatible( ast::Type const * lhs, ast::Type const * rhs ) { … … 378 374 const ast::TypeSubstitution * subst ) { 379 375 const ast::FunctionType * function = getFunctionType( expr->func->result ); 380 assertf( function, "ApplicationExpr has non-function type: %s", to String( expr->func->result ).c_str() );376 assertf( function, "ApplicationExpr has non-function type: %s", toCString( expr->func->result ) ); 381 377 TypeVarMap exprTyVars; 382 378 makeTypeVarMap( function, exprTyVars ); -
src/GenPoly/GenPoly.h
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // GenPoly.h -- 7 // GenPoly.h -- General GenPoly utilities. 8 8 // 9 9 // Author : Richard C. Bilson … … 30 30 namespace GenPoly { 31 31 32 33 34 32 struct TypeVarMap : public ErasableScopedMap<ast::TypeEnvKey, ast::TypeData> { 33 TypeVarMap() : ErasableScopedMap( ast::TypeData() ) {} 34 }; 35 35 36 /// Replaces a TypeInstType by its referrent in the environment, if applicable 37 36 /// Replaces a TypeInstType by its referrent in the environment, if applicable. 37 const ast::Type * replaceTypeInst( const ast::Type *, const ast::TypeSubstitution * ); 38 38 39 /// returns polymorphic type if is polymorphic type, NULL otherwise; will look up substitution in env if provided 40 const ast::Type * isPolyType(const ast::Type * type, const ast::TypeSubstitution * env = nullptr);39 /// Returns polymorphic type if is polymorphic type, NULL otherwise; will look up substitution in env if provided. 40 const ast::Type * isPolyType( const ast::Type * type, const ast::TypeSubstitution * subst = nullptr ); 41 41 42 /// returns polymorphic type if is polymorphic type in tyVars, NULL otherwise; will look up substitution in env if provided 43 42 /// Returns polymorphic type if is polymorphic type in tyVars, NULL otherwise; will look up substitution in env if provided. 43 const ast::Type * isPolyType( const ast::Type * type, const TypeVarMap & typeVars, const ast::TypeSubstitution * subst = nullptr ); 44 44 45 /// returns dynamic-layout type if is dynamic-layout type in tyVars, NULL otherwise; will look up substitution in env if provided 46 45 /// Returns dynamic-layout type if is dynamic-layout type in tyVars, NULL otherwise; will look up substitution in env if provided. 46 const ast::BaseInstType *isDynType( const ast::Type * type, const TypeVarMap & typeVars, const ast::TypeSubstitution * subst = 0 ); 47 47 48 /// true iff function has dynamic-layout return type under the given type variable map 49 48 /// Returns true iff function has dynamic-layout return type under the given type variable map. 49 const ast::BaseInstType *isDynRet( const ast::FunctionType * type, const TypeVarMap & typeVars ); 50 50 51 /// true iff function has dynamic-layout return type under the type variable map generated from its forall-parameters 52 51 /// Returns true iff function has dynamic-layout return type under the type variable map generated from its forall-parameters. 52 const ast::BaseInstType *isDynRet( const ast::FunctionType * func ); 53 53 54 /// A function needs an adapter if it returns a dynamic-layout value or if any of its parameters have dynamic-layout type 55 54 /// A function needs an adapter if it returns a dynamic-layout value or if any of its parameters have dynamic-layout type. 55 bool needsAdapter( ast::FunctionType const * adaptee, const TypeVarMap & typeVars ); 56 56 57 /// returns polymorphic type if is pointer to polymorphic type in tyVars, NULL otherwise; will look up substitution in env if provided 58 57 /// Returns polymorphic type if is pointer to polymorphic type in tyVars, NULL otherwise; will look up substitution in env if provided. 58 const ast::Type * isPolyPtr( const ast::Type * type, const TypeVarMap & typeVars, const ast::TypeSubstitution * env = 0 ); 59 59 60 /// if the base type (after dereferencing N >= 0 pointers) is a polymorphic type in tyVars, returns the base type, NULL otherwise;61 /// N will be stored in levels, if provided, will look up substitution in env if provided 62 60 /// If the base type (after dereferencing N >= 0 pointers) is a polymorphic type in tyVars, returns the base type, NULL otherwise; 61 /// N will be stored in levels, if provided, will look up substitution in env if provided. 62 const ast::Type * hasPolyBase( const ast::Type * type, const TypeVarMap & typeVars, int * levels = 0, const ast::TypeSubstitution * env = 0 ); 63 63 64 /// Returns a pointer to the base FunctionType if ty is the type of a function (or pointer to one), NULL otherwise 65 64 /// Returns a pointer to the base FunctionType if ty is the type of a function (or pointer to one), NULL otherwise. 65 const ast::FunctionType * getFunctionType( const ast::Type * ty ); 66 66 67 ///true iff types are structurally identical, where TypeInstType's match any type.68 67 /// Returns true iff types are structurally identical, where TypeInstType's match any type. 68 bool typesPolyCompatible( ast::Type const * lhs, ast::Type const * rhs ); 69 69 70 /// true if arg requires boxing given exprTyVars 71 70 /// Returns true if arg requires boxing given typeVars. 71 bool needsBoxing( const ast::Type * param, const ast::Type * arg, const TypeVarMap & typeVars, const ast::TypeSubstitution * subst ); 72 72 73 /// true if arg requires boxing in the call to appExpr 74 73 /// Returns true if arg requires boxing in the call to appExpr. 74 bool needsBoxing( const ast::Type * param, const ast::Type * arg, const ast::ApplicationExpr * expr, const ast::TypeSubstitution * subst ); 75 75 76 /// Adds the type variable `tyVar` to `tyVarMap` 77 78 76 /// Adds the type variable `type` to `typeVars`. 77 void addToTypeVarMap( const ast::TypeDecl * type, TypeVarMap & typeVars ); 78 void addToTypeVarMap( const ast::TypeInstType * type, TypeVarMap & typeVars ); 79 79 80 /// Adds the declarations in the forall list of type (and its pointed-to type if it's a pointer type) to `tyVarMap` 81 82 80 /// Adds the declarations in the forall list of type (and its pointed-to type if it's a pointer type) to `typeVars`. 81 void makeTypeVarMap( const ast::Type * type, TypeVarMap & typeVars ); 82 void makeTypeVarMap( const ast::FunctionDecl * decl, TypeVarMap & typeVars ); 83 83 84 /// Gets the name of the sizeof parameter for the type, given its mangled name 85 84 /// Gets the name of the sizeof parameter for the type, given its mangled name. 85 inline std::string sizeofName( const std::string &name ) { return std::string( "_sizeof_" ) + name; } 86 86 87 /// Gets the name of the alignof parameter for the type, given its mangled name 88 87 /// Gets the name of the alignof parameter for the type, given its mangled name. 88 inline std::string alignofName( const std::string &name ) { return std::string( "_alignof_" ) + name; } 89 89 90 /// Gets the name of the offsetof parameter for the type, given its mangled name 91 90 /// Gets the name of the offsetof parameter for the type, given its mangled name. 91 inline std::string offsetofName( const std::string &name ) { return std::string( "_offsetof_" ) + name; } 92 92 93 /// Gets the name of the layout function for a given aggregate type, given its declaration 94 95 96 93 /// Gets the name of the layout function for a given aggregate type, given its declaration. 94 inline std::string layoutofName( ast::AggregateDecl const * decl ) { 95 return std::string( "_layoutof_" ) + decl->name; 96 } 97 97 98 98 } // namespace GenPoly -
src/GenPoly/InstantiateGeneric.h
r89a8bab rf22b170b 16 16 #pragma once 17 17 18 #include <list> // for list19 20 class Declaration;21 18 namespace ast { 22 19 class TranslationUnit; … … 25 22 namespace GenPoly { 26 23 27 void instantiateGeneric( std::list< Declaration* > &translationUnit );28 24 void instantiateGeneric( ast::TranslationUnit & translationUnit ); 29 25 /// Replaces all generic types that have static layout with concrete -
src/GenPoly/Lvalue.h
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Lvalue.h -- 7 // Lvalue.h -- Clean up lvalues and remove references. 8 8 // 9 9 // Author : Richard C. Bilson … … 16 16 #pragma once 17 17 18 #include <list> // for list19 20 class Declaration;21 class Expression;22 18 namespace ast { 23 19 class Expr; … … 26 22 27 23 namespace GenPoly { 28 /// replaces return type of `lvalue T` with `T*`, along with appropriate address-of and dereference operators29 void convertLvalue( std::list< Declaration* >& translationUnit );30 void convertLvalue( ast::TranslationUnit & translationUnit );31 24 32 /// true after reference types have been eliminated from the source code. After this point, reference types should not be added to the AST.33 bool referencesPermissable();25 /// Replaces return type of `T&` with `T*`, along with appropriate address-of and dereference operators. 26 void convertLvalue( ast::TranslationUnit & translationUnit ); 34 27 35 /// applies transformations that allow GCC to accept more complicated lvalue expressions, e.g. &(a, b) 36 Expression * generalizedLvalue( Expression * expr ); 37 ast::Expr const * generalizedLvalue( ast::Expr const * expr ); 28 /// Returns true until reference types have been eliminated from the source code. After this point, reference types should not be added to the AST. 29 bool referencesPermissable(); 30 31 /// Applies transformations that allow GCC to accept more complicated lvalue expressions, e.g. &(a, b). 32 ast::Expr const * generalizedLvalue( ast::Expr const * expr ); 33 38 34 } // namespace GenPoly 39 35 -
src/GenPoly/ScopedSet.h
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ScopedSet.h -- 7 // ScopedSet.h -- A set that supports save/restore scoping. 8 8 // 9 9 // Author : Aaron B. Moss -
src/GenPoly/ScrubTyVars.cc
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ScrubTyVars.cc -- 7 // ScrubTyVars.cc -- Remove polymorphic types. 8 8 // 9 9 // Author : Richard C. Bilson … … 27 27 28 28 struct ScrubTypeVars : 29 public ast::WithGuards,30 public ast::WithShortCircuiting,31 public ast::WithVisitorRef<ScrubTypeVars> {29 public ast::WithGuards, 30 public ast::WithShortCircuiting, 31 public ast::WithVisitorRef<ScrubTypeVars> { 32 32 33 33 ScrubTypeVars( ScrubMode m, TypeVarMap const * tv ) : -
src/GenPoly/ScrubTyVars.h
r89a8bab rf22b170b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ScrubTyVars.h -- 7 // ScrubTyVars.h -- Remove polymorphic types. 8 8 // 9 9 // Author : Richard C. Bilson … … 19 19 20 20 #include "AST/Fwd.hpp" // for Node 21 #include "GenPoly.h" // for Ty VarMap, isPolyType, isDynType21 #include "GenPoly.h" // for TypeVarMap, isPolyType, isDynType 22 22 23 23 namespace GenPoly { -
src/GenPoly/Specialize.h
r89a8bab rf22b170b 16 16 #pragma once 17 17 18 #include <list> // for list19 20 class Declaration;21 18 namespace ast { 22 19 class TranslationUnit; … … 24 21 25 22 namespace GenPoly { 26 /// generates thunks where needed27 void convertSpecializations( std::list< Declaration* >& translationUnit );28 23 29 void convertSpecializations( ast::TranslationUnit & translationUnit ); 24 void convertSpecializations( ast::TranslationUnit & translationUnit ); 25 30 26 } // namespace GenPoly 31 27 -
src/Makefile.am
r89a8bab rf22b170b 20 20 21 21 SRC = main.cc \ 22 23 24 22 CompilationState.cc \ 23 CompilationState.h \ 24 MakeLibCfaNew.cpp \ 25 25 MakeLibCfa.h 26 26
Note: See TracChangeset
for help on using the changeset viewer.