Skip to content

Commit

Permalink
cmd: Clean up and cmnts in 3rdpartycompile
Browse files Browse the repository at this point in the history
  • Loading branch information
sangisos committed Aug 31, 2016
1 parent e5482c0 commit 3b92a05
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/3rdpartycompile/3rdpartycompile.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,16 @@ func compileFile(path string, outputPath string, goccLexer bool) error {

// Generate LLVM IR module based on the syntax tree of the given file.
module := irgen.Gen(file, info)

// Add path to uc lib.
lib, err := goutil.SrcDir("github.com/mewmew/uc/testdata")
if err != nil {
return errutil.Err(err)
}
clang := exec.Command("clang", "-o", outputPath, "-x", "ir", filepath.Join(lib, "uc.ll"), "-")
lib = filepath.Join(lib, "uc.ll")

// Link and create binary through clang
clang := exec.Command("clang", "-o", outputPath, "-x", "ir", lib, "-")
clang.Stdin = strings.NewReader(module.String())
clang.Stderr = os.Stderr
clang.Stdout = os.Stdout
Expand Down

0 comments on commit 3b92a05

Please sign in to comment.