Skip to content

Commit

Permalink
don't use compiler execute on the llvm test
Browse files Browse the repository at this point in the history
  • Loading branch information
mbellotti committed Apr 14, 2023
1 parent b4be1ed commit 4a27343
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions llvm/llvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fault/ast"
"fault/listener"
"fault/preprocess"
"fault/swaps"
"fault/types"
"fmt"
"io"
Expand Down Expand Up @@ -732,13 +733,15 @@ func prepTest(test string, specType bool) (string, error) {
l := listener.Execute(test, "", flags)
pre := preprocess.Execute(l)
ty := types.Execute(pre.Processed, pre)
sw := swaps.NewPrecompiler(ty)
tree := sw.Swap(ty.Checked)
compiler := NewCompiler()
compiler.LoadMeta(ty.SpecStructs, l.Uncertains, l.Unknowns, true)
err := compiler.Compile(ty.Checked)
err := compiler.Compile(tree)
if err != nil {
return "", err
}
//fmt.Println(compiler.GetIR())
fmt.Println(compiler.GetIR())
return compiler.GetIR(), err
}

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func parse(data string, path string, file string, filetype string, reach bool, v
ty := types.Execute(pre.Processed, pre)

sw := swaps.NewPrecompiler(ty)
tree = sw.Swap(tree)
tree := sw.Swap(ty.Checked)

var visual string
if visu {
Expand All @@ -52,7 +52,7 @@ func parse(data string, path string, file string, filetype string, reach bool, v
r := reachability.NewTracer()
r.Scan(ty.Checked)
}
return ty.Checked, lstnr, ty, visual
return tree, lstnr, ty, visual
}

func validate_filetype(data string, filetype string) bool {
Expand Down
5 changes: 4 additions & 1 deletion smt/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fault/listener"
"fault/llvm"
"fault/preprocess"
"fault/swaps"
"fault/types"
"fault/util"
"fmt"
Expand Down Expand Up @@ -608,7 +609,9 @@ func prepTest(filepath string, test string, specType bool, testRun bool) string
l := listener.Execute(test, path, flags)
pre := preprocess.Execute(l)
ty := types.Execute(pre.Processed, pre)
compiler := llvm.Execute(ty.Checked, ty.SpecStructs, l.Uncertains, l.Unknowns, true)
sw := swaps.NewPrecompiler(ty)
tree := sw.Swap(ty.Checked)
compiler := llvm.Execute(tree, ty.SpecStructs, l.Uncertains, l.Unknowns, true)

//fmt.Println(compiler.GetIR())
generator := Execute(compiler)
Expand Down

0 comments on commit 4a27343

Please sign in to comment.