compiler: rename .Parse() to .Compiler()

The fact it was called Parse() is more of a historical accident, as the
compiler started out using the Go AST directly instead of Go SSA.
This commit is contained in:
Ayke van Laethem
2018-09-24 15:54:39 +02:00
parent 1b229a8f8b
commit 6191d4e1ac
2 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -32,13 +32,13 @@ func Compile(pkgName, outpath string, spec *TargetSpec, printIR, dumpSSA bool, p
// Compile Go code to IR.
parseErr := func() error {
if printIR {
// Run this even if c.Parse() panics.
// Run this even if c.Compile() panics.
defer func() {
fmt.Println("Generated LLVM IR:")
fmt.Println(c.IR())
}()
}
return c.Parse(pkgName)
return c.Compile(pkgName)
}()
if parseErr != nil {
return parseErr
@@ -203,7 +203,7 @@ func Run(pkgName string) error {
if err != nil {
return errors.New("compiler: " + err.Error())
}
err = c.Parse(pkgName)
err = c.Compile(pkgName)
if err != nil {
return errors.New("compiler: " + err.Error())
}