diff --git a/src/Var.cc b/src/Var.cc index 7524952975..189b657c14 100644 --- a/src/Var.cc +++ b/src/Var.cc @@ -681,7 +681,7 @@ public: TraversalCode PostExpr(const Expr*) override; std::vector scopes; - std::unordered_set outer_id_references; + std::unordered_set outer_id_references; }; TraversalCode OuterIDBindingFinder::PreExpr(const Expr* expr) @@ -707,7 +707,7 @@ TraversalCode OuterIDBindingFinder::PreExpr(const Expr* expr) // not something we have to worry about also being at outer scope. return TC_CONTINUE; - outer_id_references.insert(e); + outer_id_references.insert(e->Id()); return TC_CONTINUE; } @@ -773,8 +773,8 @@ IDPList gather_outer_ids(Scope* scope, Stmt* body) IDPList idl; - for ( auto ne : cb.outer_id_references ) - idl.append(ne->Id()); + for ( auto id : cb.outer_id_references ) + idl.append(id); return idl; } diff --git a/src/script_opt/Inline.h b/src/script_opt/Inline.h index 5c3a64a778..1b579d51cc 100644 --- a/src/script_opt/Inline.h +++ b/src/script_opt/Inline.h @@ -29,7 +29,7 @@ public: ExprPtr CheckForInlining(CallExprPtr c); // True if the given function has been inlined. - bool WasInlined(Func* f) { return inline_ables.count(f) > 0; } + bool WasInlined(const Func* f) { return inline_ables.count(f) > 0; } protected: // Driver routine that analyzes all of the script functions and @@ -44,7 +44,7 @@ protected: std::vector& funcs; // Functions that we've determined to be suitable for inlining. - std::unordered_set inline_ables; + std::unordered_set inline_ables; // As we do inlining for a given function, this tracks the // largest frame size of any inlined function. diff --git a/src/script_opt/ScriptOpt.h b/src/script_opt/ScriptOpt.h index bf6a3e813a..242f9d987a 100644 --- a/src/script_opt/ScriptOpt.h +++ b/src/script_opt/ScriptOpt.h @@ -64,12 +64,12 @@ class FuncInfo { public: FuncInfo(ScriptFuncPtr _func, ScopePtr _scope, StmtPtr _body); - ScriptFunc* Func() { return func.get(); } - ScriptFuncPtr FuncPtr() { return func; } - ScopePtr Scope() { return scope; } - StmtPtr Body() { return body; } - std::shared_ptr Profile() { return pf; } - const std::string& SaveFile() { return save_file; } + ScriptFunc* Func() const { return func.get(); } + ScriptFuncPtr FuncPtr() const { return func; } + ScopePtr Scope() const { return scope; } + StmtPtr Body() const { return body; } + std::shared_ptr Profile() const { return pf; } + const std::string& SaveFile() const { return save_file; } void SetBody(StmtPtr new_body) { body = std::move(new_body); } void SetProfile(std::shared_ptr _pf);