Remove structopt dependency from LLVM

This commit is contained in:
Syrus
2019-08-08 19:42:41 -07:00
parent 27d8506a46
commit d39d4b5f6d
3 changed files with 35 additions and 16 deletions

View File

@ -17,7 +17,6 @@ mod structs;
mod trampolines;
use std::path::PathBuf;
use structopt::StructOpt;
pub use code::LLVMFunctionCodeGenerator as FunctionCodeGenerator;
pub use code::LLVMModuleCodeGenerator as ModuleCodeGenerator;
@ -31,23 +30,20 @@ pub type LLVMCompiler = SimpleStreamingCompilerGen<
code::CodegenError,
>;
#[derive(Debug, StructOpt, Clone)]
#[derive(Debug, Clone)]
/// LLVM backend flags.
pub struct CLIOptions {
pub struct LLVMOptions {
/// Emit LLVM IR before optimization pipeline.
#[structopt(long = "backend-llvm-pre-opt-ir", parse(from_os_str))]
pre_opt_ir: Option<PathBuf>,
pub pre_opt_ir: Option<PathBuf>,
/// Emit LLVM IR after optimization pipeline.
#[structopt(long = "backend-llvm-post-opt-ir", parse(from_os_str))]
post_opt_ir: Option<PathBuf>,
pub post_opt_ir: Option<PathBuf>,
/// Emit LLVM generated native code object file.
#[structopt(long = "backend-llvm-object-file", parse(from_os_str))]
obj_file: Option<PathBuf>,
pub obj_file: Option<PathBuf>,
}
pub static mut GLOBAL_OPTIONS: CLIOptions = CLIOptions {
pub static mut GLOBAL_OPTIONS: LLVMOptions = LLVMOptions {
pre_opt_ir: None,
post_opt_ir: None,
obj_file: None,