Changeset 41cde266 for src/AST/Print.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/Print.cpp

    rc5a98f3 r41cde266  
    155155        }
    156156
     157        void print( const ast::FunctionType::AssertionList & assts ) {
     158                if (assts.empty()) return;
     159                os << "with assertions" << endl;
     160                ++indent;
     161                printAll(assts);
     162                os << indent;
     163                --indent;
     164        }
     165
    157166        void print( const std::vector<ptr<Attribute>> & attrs ) {
    158167                if ( attrs.empty() ) return;
     
    206215        void preprint( const ast::NamedTypeDecl * node ) {
    207216                if ( ! node->name.empty() ) {
    208                         if( deterministic_output && isUnboundType(node->name) ) os << "[unbound]:";
    209                         else os << node->name << ": ";
     217                        os << node->name << ": ";
    210218                }
    211219
     
    261269        void preprint( const ast::FunctionType * node ) {
    262270                print( node->forall );
     271                print( node->assertions );
    263272                print( node->qualifiers );
    264273        }
     
    13751384        virtual const ast::Type * visit( const ast::TypeInstType * node ) override final {
    13761385                preprint( node );
    1377                 const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->name;
     1386                const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->typeString();
    13781387                os << "instance of type " << _name
    13791388                   << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)";
     
    15021511                os << indent << "Types:" << endl;
    15031512                for ( const auto& i : *node ) {
    1504                         os << indent+1 << i.first << " -> ";
     1513                        os << indent+1 << i.first.typeString() << " -> ";
    15051514                        indent += 2;
    15061515                        safe_print( i.second );
    1507                         indent -= 2;
    1508                         os << endl;
    1509                 }
    1510                 os << indent << "Non-types:" << endl;
    1511                 for ( auto i = node->beginVar(); i != node->endVar(); ++i ) {
    1512                         os << indent+1 << i->first << " -> ";
    1513                         indent += 2;
    1514                         safe_print( i->second );
    15151516                        indent -= 2;
    15161517                        os << endl;
Note: See TracChangeset for help on using the changeset viewer.