Changeset 41cde266 for src/AST/Type.cpp


Ignore:
Timestamp:
Dec 17, 2020, 4:18:23 PM (10 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
089b1a9, f4f79dd
Parents:
c5a98f3 (diff), 68a867ee (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Type.cpp

    rc5a98f3 r41cde266  
    2121
    2222#include "Decl.hpp"
    23 #include "ForallSubstitutor.hpp" // for substituteForall
    2423#include "Init.hpp"
    2524#include "Common/utility.h"      // for copy, move
     
    9291// GENERATED END
    9392
    94 // --- ParameterizedType
    95 
    96 void FunctionType::initWithSub(
    97         const FunctionType & o, Pass< ForallSubstitutor > & sub
    98 ) {
    99         forall = sub.core( o.forall );
    100 }
    101 
    10293// --- 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 
    11494namespace {
    11595        bool containsTtype( const std::vector<ptr<Type>> & l ) {
     
    199179                // TODO: once TypeInstType representation is updated, it should properly check
    200180                // if the context id is filled. this is a temporary hack for now
    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;
     181                return typeInst->formal_usage > 0;
    213182        }
    214183        return false;
Note: See TracChangeset for help on using the changeset viewer.