Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: runtime/vm/kernel_to_il.h

Issue 2477563003: VM: [Kernel] Set types on [LocalVariable] if they were introduced by [VariableDeclaration]s (Closed)
Patch Set: addressed comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.h
diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h
index eb3beca9ce37eb05b396e045af259ec6b7b54d00..6a62834140b2d1257a8dcbc88226edf9ff08c6e3 100644
--- a/runtime/vm/kernel_to_il.h
+++ b/runtime/vm/kernel_to_il.h
@@ -296,6 +296,9 @@ class DartTypeTranslator : public DartTypeVisitor {
// Can return a malformed type.
AbstractType& TranslateTypeWithoutFinalization(DartType* node);
+ // Is guaranteed to be not malformed.
+ const AbstractType& TranslateVariableType(VariableDeclaration* variable);
+
virtual void VisitDefaultDartType(DartType* node) { UNREACHABLE(); }
@@ -494,6 +497,7 @@ class ScopeBuilder : public RecursiveVisitor {
node_(node),
zone_(Thread::Current()->zone()),
translation_helper_(Thread::Current(), zone_, Isolate::Current()),
+ type_translator_(&translation_helper_, &active_class_),
current_function_scope_(NULL),
scope_(NULL),
depth_(0),
@@ -534,8 +538,9 @@ class ScopeBuilder : public RecursiveVisitor {
void EnterScope(TreeNode* node);
void ExitScope();
- LocalVariable* MakeVariable(const dart::String& name);
- LocalVariable* MakeVariable(const dart::String& name, const Type& type);
+ const Type& TranslateVariableType(VariableDeclaration* variable);
+ LocalVariable* MakeVariable(const dart::String& name,
+ const AbstractType& type);
void AddParameters(FunctionNode* function, intptr_t pos = 0);
void AddParameter(VariableDeclaration* declaration, intptr_t pos);
@@ -581,9 +586,11 @@ class ScopeBuilder : public RecursiveVisitor {
ParsedFunction* parsed_function_;
TreeNode* node_;
+ ActiveClass active_class_;
+
Zone* zone_;
TranslationHelper translation_helper_;
-
+ DartTypeTranslator type_translator_;
FunctionNode* current_function_node_;
LocalScope* current_function_scope_;
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698