2016-11-23 16:26:45 +01:00
|
|
|
// Copyright 2016 Marapongo, Inc. All rights reserved.
|
|
|
|
|
|
|
|
package compiler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/golang/glog"
|
|
|
|
|
|
|
|
"github.com/marapongo/mu/pkg/ast"
|
|
|
|
"github.com/marapongo/mu/pkg/compiler/backends"
|
|
|
|
"github.com/marapongo/mu/pkg/compiler/core"
|
|
|
|
"github.com/marapongo/mu/pkg/workspace"
|
|
|
|
)
|
|
|
|
|
|
|
|
// buildDocumentBE runs the back-end phases of the compiler.
|
|
|
|
func (c *compiler) buildDocumentBE(w workspace.W, stack *ast.Stack) {
|
|
|
|
if c.opts.SkipCodegen {
|
|
|
|
glog.V(2).Infof("Skipping code-generation (opts.SkipCodegen=true)")
|
|
|
|
} else {
|
2016-11-29 22:42:39 +01:00
|
|
|
glog.V(2).Infof("Stack %v targets cluster=%v arch=%v", stack.Name, c.ctx.Cluster.Name, c.ctx.Arch)
|
2016-11-23 16:26:45 +01:00
|
|
|
|
2016-11-29 22:42:39 +01:00
|
|
|
// Now get the backend cloud provider to process the stack from here on out.
|
|
|
|
be := backends.New(c.ctx.Arch, c.Diag())
|
|
|
|
be.CodeGen(core.Compiland{c.ctx.Cluster, stack})
|
2016-11-23 16:26:45 +01:00
|
|
|
}
|
|
|
|
}
|