Commit dd7aa0d5 authored by Marius Wachtler's avatar Marius Wachtler

Cache SourceInfo::getScopeInfo

parent ceb3e449
......@@ -63,6 +63,7 @@ SourceInfo::SourceInfo(BoxedModule* m, ScopingAnalysis* scoping, FutureFlags fut
std::vector<AST_stmt*> body, std::string fn)
: parent_module(m),
scoping(scoping),
scope_info(NULL),
future_flags(future_flags),
ast(ast),
cfg(NULL),
......
......@@ -127,7 +127,9 @@ Box* SourceInfo::getDocString() {
}
ScopeInfo* SourceInfo::getScopeInfo() {
return scoping->getScopeInfoForNode(ast);
if (!scope_info)
scope_info = scoping->getScopeInfoForNode(ast);
return scope_info;
}
LivenessAnalysis* SourceInfo::getLiveness() {
......
......@@ -328,6 +328,7 @@ class SourceInfo {
public:
BoxedModule* parent_module;
ScopingAnalysis* scoping;
ScopeInfo* scope_info;
FutureFlags future_flags;
AST* ast;
CFG* cfg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment