src/compiler/CompileContext.cpp
changeset 260 05de34f712fe
parent 258 241d082d6d89
child 262 c4b1341297e5
     1.1 --- a/src/compiler/CompileContext.cpp	Sat Jan 12 16:26:09 2013 -0800
     1.2 +++ b/src/compiler/CompileContext.cpp	Sat Jan 12 16:35:26 2013 -0800
     1.3 @@ -231,7 +231,7 @@
     1.4  bool
     1.5  CompileContext::add(Handle<Module> module)
     1.6  {
     1.7 -    if (module->compiled())
     1.8 +    if (module->compiled() || module->translationUnit())
     1.9          return true;
    1.10  
    1.11      TranslationUnit *tu = new (zone_->pool()) TranslationUnit(module);
    1.12 @@ -239,6 +239,8 @@
    1.13      if (!unparsed_.append(tu) || !units_.append(tu))
    1.14          return false;
    1.15  
    1.16 +    module->setTranslationUnit(tu);
    1.17 +
    1.18      return true;
    1.19  }
    1.20  
    1.21 @@ -289,9 +291,6 @@
    1.22          if (unit->failed())
    1.23              continue;
    1.24  
    1.25 -        // Mark the module as currently in translation.
    1.26 -        unit->module()->setTranslationUnit(unit);
    1.27 -
    1.28          PopulateNamesAndTypes(zone_, *this, unit);
    1.29      }
    1.30  
    1.31 @@ -309,11 +308,6 @@
    1.32          BindNamesAndTypes(zone_, *this, unit);
    1.33      }
    1.34  
    1.35 -    // Intermediate phase. Decide which modules we should not perform
    1.36 -    // semantic analysis on.
    1.37 -    if (!propagateFailure())
    1.38 -        return false;
    1.39 -
    1.40      // Phase 4. Now we can finally perform SemA+bytecode compilation.
    1.41      for (size_t i = 0; i < units_.length(); i++) {
    1.42          TranslationUnit *unit = units_[i];