Changeset a935892 for src/GenPoly


Ignore:
Timestamp:
Jun 3, 2019, 10:54:01 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0e315a5, dafe9e1
Parents:
043a5b6 (diff), 8d70648 (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

Location:
src/GenPoly
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.cc

    r043a5b6 ra935892  
    2424#include <vector>                       // for vector
    2525
     26#include "AST/Type.hpp"
    2627#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
    2728#include "ResolvExpr/typeops.h"         // for flatten
     
    262263                } else {
    263264                        return dynamic_cast< FunctionType* >( ty ); // pointer if FunctionType, NULL otherwise
     265                }
     266        }
     267
     268        const ast::FunctionType * getFunctionType( const ast::Type * ty ) {
     269                if ( auto pty = dynamic_cast< const ast::PointerType * >( ty ) ) {
     270                        return pty->base.as< ast::FunctionType >();
     271                } else {
     272                        return dynamic_cast< const ast::FunctionType * >( ty );
    264273                }
    265274        }
  • src/GenPoly/GenPoly.h

    r043a5b6 ra935892  
    2020
    2121#include "ErasableScopedMap.h"    // for ErasableScopedMap
     22#include "AST/Fwd.hpp"
    2223#include "SymTab/Mangler.h"       // for Mangler
    2324#include "SynTree/Declaration.h"  // for TypeDecl::Data, AggregateDecl, Type...
     
    7273        /// Returns a pointer to the base FunctionType if ty is the type of a function (or pointer to one), NULL otherwise
    7374        FunctionType *getFunctionType( Type *ty );
     75        const ast::FunctionType * getFunctionType( const ast::Type * ty );
    7476
    7577        /// If expr (after dereferencing N >= 0 pointers) is a variable expression, returns the variable expression, NULL otherwise;
Note: See TracChangeset for help on using the changeset viewer.