Compare commits
7 Commits
326ed52324
...
966ce7a659
Author | SHA1 | Date |
---|---|---|
David Mak | 966ce7a659 | |
David Mak | 5ea7a672e6 | |
David Mak | 894583eb13 | |
David Mak | cb3939634e | |
Sebastien Bourdeauducq | 66f07b5bf4 | |
David Mak | 008d50995c | |
David Mak | 474f9050ce |
|
@ -2,16 +2,16 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1693636127,
|
||||
"narHash": "sha256-ZlS/lFGzK7BJXX2YVGnP3yZi3T9OLOEtBCyMJsb91U8=",
|
||||
"lastModified": 1694183432,
|
||||
"narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9075cba53e86dc318d159aee55dc9a7c9a4829c1",
|
||||
"rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-23.05",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
description = "The third-generation ARTIQ compiler";
|
||||
|
||||
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05;
|
||||
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
|
|
|
@ -6,7 +6,7 @@ use inkwell::{
|
|||
OptimizationLevel,
|
||||
};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use std::{borrow::Borrow, collections::HashMap, fs, mem::transmute, path::Path, sync::Arc};
|
||||
use std::{borrow::Borrow, collections::HashMap, fs, path::Path, sync::Arc};
|
||||
|
||||
use nac3core::{
|
||||
codegen::{
|
||||
|
@ -207,7 +207,13 @@ fn main() {
|
|||
.map(|arg| if arg == "native" { host_target_machine.cpu.clone() } else { arg })
|
||||
.unwrap_or_default();
|
||||
let target_features = target_features.unwrap_or_default();
|
||||
let opt_level: OptimizationLevel = unsafe { transmute(opt_level) };
|
||||
let opt_level = match opt_level {
|
||||
0 => OptimizationLevel::None,
|
||||
1 => OptimizationLevel::Less,
|
||||
2 => OptimizationLevel::Default,
|
||||
// The default behavior for -O<n> where n>3 defaults to O3 for both Clang and GCC
|
||||
_ => OptimizationLevel::Aggressive,
|
||||
};
|
||||
|
||||
let program = match fs::read_to_string(file_name.clone()) {
|
||||
Ok(program) => program,
|
||||
|
|
Loading…
Reference in New Issue