Changeset bdd0755


Ignore:
Timestamp:
May 3, 2017, 5:19:01 PM (5 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
262f085
Parents:
ca946a4
git-author:
Rob Schluntz <rschlunt@…> (05/03/17 17:18:35)
git-committer:
Rob Schluntz <rschlunt@…> (05/03/17 17:19:01)
Message:

fix prettyprint codegen for typedecl

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rca946a4 rbdd0755  
    262262                        } // if
    263263                } else {
    264                         output << typeDecl->typeString() << " " << typeDecl->get_name();
     264                        output << typeDecl->genTypeString() << " " << typeDecl->get_name();
     265                        if ( typeDecl->get_kind() != TypeDecl::Any && typeDecl->get_sized() ) {
     266                                output << " | sized(" << typeDecl->get_name() << ")";
     267                        }
    265268                        if ( ! typeDecl->get_assertions().empty() ) {
    266269                                output << " | { ";
  • src/SynTree/Declaration.h

    rca946a4 rbdd0755  
    204204
    205205        virtual std::string typeString() const;
     206        virtual std::string genTypeString() const;
    206207
    207208        virtual TypeDecl *clone() const { return new TypeDecl( *this ); }
  • src/SynTree/TypeDecl.cc

    rca946a4 rbdd0755  
    2929}
    3030
     31std::string TypeDecl::genTypeString() const {
     32        static const std::string kindNames[] = { "otype", "dtype", "ftype", "ttype" };
     33        return kindNames[ kind ];
     34}
     35
    3136std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data ) {
    3237  return os << data.kind << ", " << data.isComplete;
Note: See TracChangeset for help on using the changeset viewer.