mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
@ -8,12 +8,11 @@ import (
|
||||
os.cmdline
|
||||
strings
|
||||
filepath
|
||||
//compiler.x64
|
||||
v.gen.x64
|
||||
compiler.x64
|
||||
//v.table
|
||||
//v.parser
|
||||
//v.gen
|
||||
//v.types
|
||||
v.table
|
||||
v.parser
|
||||
v.gen
|
||||
)
|
||||
|
||||
pub const (
|
||||
@ -71,7 +70,7 @@ pub mut:
|
||||
compiled_dir string // contains os.realpath() of the dir of the final file beeing compiled, or the dir itself when doing `v .`
|
||||
table &Table // table with types, vars, functions etc
|
||||
cgen &CGen // C code generator
|
||||
//x64 &x64.Gen
|
||||
x64 &x64.Gen
|
||||
pref &Preferences // all the preferences and settings extracted to a struct for reusability
|
||||
lang_dir string // "~/code/v"
|
||||
out_name string // "program.exe"
|
||||
@ -142,7 +141,6 @@ pub mut:
|
||||
x64 bool
|
||||
output_cross_c bool
|
||||
prealloc bool
|
||||
v2 bool
|
||||
}
|
||||
|
||||
// Should be called by main at the end of the compilation process, to cleanup
|
||||
@ -380,6 +378,7 @@ pub fn (v mut V) compile() {
|
||||
v.cc()
|
||||
}
|
||||
|
||||
/*
|
||||
pub fn (v mut V) compile2() {
|
||||
if os.user_os() != 'windows' && v.pref.ccompiler == 'msvc' {
|
||||
verror('Cannot build with msvc on ${os.user_os()}')
|
||||
@ -414,6 +413,7 @@ pub fn (v mut V) compile2() {
|
||||
v.cc()
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
pub fn (v mut V) compile_x64() {
|
||||
$if !linux {
|
||||
@ -422,18 +422,14 @@ pub fn (v mut V) compile_x64() {
|
||||
}
|
||||
v.files << v.v_files_from_dir(filepath.join(v.pref.vlib_path,'builtin','bare'))
|
||||
v.files << v.dir
|
||||
|
||||
table := &table.Table{}
|
||||
files := parser.parse_files(v.files, table)
|
||||
x64.gen(files, v.out_name)
|
||||
/*
|
||||
v.x64.generate_elf_header()
|
||||
for f in v.files {
|
||||
v.parse(f, .decl)
|
||||
}
|
||||
for f in v.files {
|
||||
v.parse(f, .main)
|
||||
}
|
||||
*/
|
||||
v.x64.generate_elf_footer()
|
||||
}
|
||||
|
||||
fn (v mut V) generate_init() {
|
||||
@ -1141,7 +1137,6 @@ pub fn new_v(args []string) &V {
|
||||
user_mod_path: user_mod_path
|
||||
vlib_path: vlib_path
|
||||
vpath: vpath
|
||||
v2: '-v2' in args
|
||||
}
|
||||
if pref.is_verbose || pref.is_debug {
|
||||
println('C compiler=$pref.ccompiler')
|
||||
@ -1163,7 +1158,7 @@ pub fn new_v(args []string) &V {
|
||||
table: new_table(obfuscate)
|
||||
out_name_c: out_name_c
|
||||
cgen: new_cgen(out_name_c)
|
||||
//x64: x64.new_gen(out_name)
|
||||
x64: x64.new_gen(out_name)
|
||||
vroot: vroot
|
||||
pref: pref
|
||||
mod: mod
|
||||
|
Reference in New Issue
Block a user