Ignore:
Timestamp:
Feb 8, 2023, 2:27:55 PM (3 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, master
Children:
b110bcc
Parents:
997185e (diff), ccb29b4 (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/GenPoly/GenPoly.cc

    r997185e r2ed94a9  
    2424#include <vector>                       // for vector
    2525
     26#include "AST/Expr.hpp"
    2627#include "AST/Type.hpp"
     28#include "AST/TypeSubstitution.hpp"
    2729#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
    2830#include "ResolvExpr/typeops.h"         // for flatten
     
    170172
    171173                if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( type ) ) {
    172                         if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) {
     174                        if ( tyVars.contains( typeInst->get_name() ) ) {
    173175                                return type;
    174176                        }
     
    187189
    188190                if ( auto typeInst = dynamic_cast< const ast::TypeInstType * >( type ) ) {
    189                         return tyVars.find(typeInst->typeString()) != tyVars.end() ? type : nullptr;
     191                        if ( tyVars.contains( typeInst->typeString() ) ) return type;
    190192                } else if ( auto arrayType = dynamic_cast< const ast::ArrayType * >( type ) ) {
    191193                        return isPolyType( arrayType->base, env );
     
    203205
    204206        if ( auto inst = dynamic_cast< const ast::TypeInstType * >( type ) ) {
    205                 if ( typeVars.find( *inst ) != typeVars.end() ) return type;
     207                if ( typeVars.contains( *inst ) ) return type;
    206208        } else if ( auto array = dynamic_cast< const ast::ArrayType * >( type ) ) {
    207209                return isPolyType( array->base, subst );
     
    391393
    392394                if ( TypeInstType *typeInstType = dynamic_cast< TypeInstType * >( type ) ) {
    393                         if ( tyVars.find( typeInstType->get_name() ) != tyVars.end() ) {
     395                        if ( tyVars.contains( typeInstType->get_name() ) ) {
    394396                                return true;
    395397                        }
     
    490492                }
    491493
     494                /// Flattens a list of types.
     495                // There is another flattenList in Unify.
    492496                void flattenList( vector<ast::ptr<ast::Type>> const & src,
    493497                                vector<ast::ptr<ast::Type>> & out ) {
Note: See TracChangeset for help on using the changeset viewer.