1.1 --- a/src/compiler/NameBinding.cpp Sat Dec 29 00:12:27 2012 -0800
1.2 +++ b/src/compiler/NameBinding.cpp Sat Dec 29 00:55:38 2012 -0800
1.3 @@ -111,18 +111,18 @@
1.4 {
1.5 }
1.6
1.7 - bool analyze() {
1.8 + void analyze() {
1.9 ImportScope *importScope = ImportScope::New(pool_);
1.10 if (!importScope)
1.11 - return false;
1.12 + return;
1.13
1.14 // At the import level, we declare system types.
1.15 if (!declareSystemTypes(importScope))
1.16 - return false;
1.17 + return;
1.18
1.19 GlobalScope *globalScope = GlobalScope::New(pool_, importScope);
1.20 if (!globalScope)
1.21 - return false;
1.22 + return;
1.23
1.24 unit_->setImportScope(importScope);
1.25 unit_->setGlobalScope(globalScope);
1.26 @@ -134,7 +134,7 @@
1.27 stmt->accept(this);
1.28 }
1.29
1.30 - return true;
1.31 + return;
1.32 }
1.33
1.34 bool declareSystemType(ImportScope *scope, const char *name, Handle<Type> type) {
1.35 @@ -480,11 +480,12 @@
1.36 FunctionScope *fun_;
1.37 };
1.38
1.39 -bool
1.40 +void
1.41 ke::PopulateNamesAndTypes(Zone *zone, CompileContext &cc, TranslationUnit *unit)
1.42 {
1.43 + AutoEnterCompileContext enter(cc, unit);
1.44 NamePopulator populator(zone, cc, unit);
1.45 - return populator.analyze();
1.46 + populator.analyze();
1.47 }
1.48
1.49 static const int INFER_ARRAY_SIZE = 0;
1.50 @@ -534,7 +535,7 @@
1.51 {
1.52 }
1.53
1.54 - bool bind() {
1.55 + void bind() {
1.56 // Start with the import scope, and collect all imported names.
1.57 AutoLinkScope importScope(&link_, unit_->importScope());
1.58
1.59 @@ -547,8 +548,6 @@
1.60 Statement *stmt = unit_->tree()->statements()->at(i);
1.61 stmt->accept(this);
1.62 }
1.63 -
1.64 - return true;
1.65 }
1.66
1.67 void visitVariableDeclaration(VariableDeclaration *node) {
1.68 @@ -973,9 +972,10 @@
1.69 AutoLinkScope *link_;
1.70 };
1.71
1.72 -bool
1.73 +void
1.74 ke::BindNamesAndTypes(Zone *zone, CompileContext &cc, TranslationUnit *unit)
1.75 {
1.76 + AutoEnterCompileContext enter(cc, unit);
1.77 NameBinder binder(zone, cc, unit);
1.78 - return binder.bind();
1.79 + binder.bind();
1.80 }