Compiler uses a default optimization level when unconfigured

This commit is contained in:
Sasha Koshka 2024-02-26 13:46:54 -05:00
parent a418baa113
commit 04420cb7d3

View File

@ -94,11 +94,14 @@ func (this *Compiler) CompileIRModule (module *llvm.Module, filetype string) err
// - clang
// If none were found, it returns an error.
func (this *Compiler) FindBackend (filetype string) (string, []string, error) {
optimization := "0"
if this.Optimization != "" { optimization = this.Optimization }
llcArgs := []string {
"-",
fmt.Sprintf("-filetype=%s", filetype),
"-o", this.Output,
fmt.Sprintf("-O=%s", this.Optimization),
fmt.Sprintf("-O=%s", optimization),
}
// attempt to use llc command