code: public void initOptions(CompilerOptions options) {
      this.options = options;
      this.setFeatureSet(options.getLanguageIn().toFeatureSet());
      if (errorManager == null) {
        if (this.outStream == null) {
          setErrorManager(
              new LoggerErrorManager(createMessageFormatter(), logger));
        } else {
          ImmutableSet.Builder<ErrorReportGenerator> builder = ImmutableSet.builder();
          builder.add(
              new PrintStreamErrorReportGenerator(
                  createMessageFormatter(), this.outStream, options.summaryDetailLevel));
          builder.addAll(options.getExtraReportGenerators());
          setErrorManager(new SortingErrorManager(builder.build()));
        }
      }
  
      moduleLoader = ModuleLoader.EMPTY;
  
      reconcileOptionsWithGuards();
  
      // TODO(johnlenz): generally, the compiler should not be changing the options object
      // provided by the user.  This should be handled a different way.
  
      // Turn off type-based optimizations when type checking is off
      if (!options.isTypecheckingEnabled()) {
        options.setUseTypesForLocalOptimization(false);
        options.setUseTypesForOptimization(false);
      }
  
      if (options.legacyCodeCompile) {
        options.setDisambiguateProperties(false);
        options.setAmbiguateProperties(false);
        options.useNonStrictWarningsGuard();
      }
  
      if (options.assumeForwardDeclaredForMissingTypes) {
        this.forwardDeclaredTypes =
            new AbstractSet<String>() {
              @Override
              public boolean contains(Object o) {
                return true; // Report all types as forward declared types.
              }
  
              @Override
              public boolean add(String e) {
                return false;
              }
  
              @Override
              public Iterator<String> iterator() {
                return Collections.<String>emptySet().iterator();
              }
  
              @Override
              public int size() {
                return 0;
              }
            };
      }
  
      initWarningsGuard(options.getWarningsGuard());
    }
docs: Initializes the compiler options. It's called as part of a normal compile() job.
  Public for the callers that are not doing a normal compile() job.