Changes in src/AST/Type.cpp [3e5dd913:361bf01]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Type.cpp
r3e5dd913 r361bf01 21 21 22 22 #include "Decl.hpp" 23 #include "ForallSubstitutor.hpp" // for substituteForall 23 24 #include "Init.hpp" 24 25 #include "Common/utility.h" // for copy, move … … 91 92 // GENERATED END 92 93 94 // --- ParameterizedType 95 96 void FunctionType::initWithSub( 97 const FunctionType & o, Pass< ForallSubstitutor > & sub 98 ) { 99 forall = sub.core( o.forall ); 100 } 101 93 102 // --- FunctionType 103 104 105 FunctionType::FunctionType( const FunctionType & o ) 106 : Type( o.qualifiers, copy( o.attributes ) ), returns(), params(), 107 isVarArgs( o.isVarArgs ) { 108 Pass< ForallSubstitutor > sub; 109 initWithSub( o, sub ); // initialize substitution map 110 returns = sub.core( o.returns ); // apply to return and parameter types 111 params = sub.core( o.params ); 112 } 113 94 114 namespace { 95 115 bool containsTtype( const std::vector<ptr<Type>> & l ) { … … 179 199 // TODO: once TypeInstType representation is updated, it should properly check 180 200 // if the context id is filled. this is a temporary hack for now 181 return typeInst->formal_usage > 0; 201 return isUnboundType(typeInst->name); 202 } 203 return false; 204 } 205 206 bool isUnboundType(const std::string & tname) { 207 // xxx - look for a type name produced by renameTyVars. 208 209 // TODO: once TypeInstType representation is updated, it should properly check 210 // if the context id is filled. this is a temporary hack for now 211 if (std::count(tname.begin(), tname.end(), '_') >= 3) { 212 return true; 182 213 } 183 214 return false;
Note: See TracChangeset
for help on using the changeset viewer.