Ignore:
Timestamp:
Nov 10, 2020, 3:14:14 AM (3 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
3ff4c1e
Parents:
18f0b70
Message:

delay autogen resolve

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r18f0b70 r0dd9a5e  
    12891289                void beginScope() { managedTypes.beginScope(); }
    12901290                void endScope() { managedTypes.endScope(); }
     1291                bool onError(ast::ptr<ast::Decl> & decl);
    12911292        };
    12921293        // size_t Resolver_new::traceId = Stats::Heap::new_stacktrace_id("Resolver");
     
    20662067        }
    20672068
     2069        // suppress error on autogen functions and mark invalid autogen as deleted.
     2070        bool Resolver_new::onError(ast::ptr<ast::Decl> & decl) {
     2071                if (auto functionDecl = decl.as<ast::FunctionDecl>()) {
     2072                        // xxx - can intrinsic gen ever fail?
     2073                        if (functionDecl->linkage == ast::Linkage::AutoGen) {
     2074                                auto mutDecl = mutate(functionDecl);
     2075                                mutDecl->isDeleted = true;
     2076                                mutDecl->stmts = nullptr;
     2077                                decl = mutDecl;
     2078                                return false;
     2079                        }
     2080                }
     2081                return true;
     2082        }
     2083
    20682084} // namespace ResolvExpr
    20692085
Note: See TracChangeset for help on using the changeset viewer.