Skip to content

Commit a7912e4

Browse files
committed
all: remove the old -b native backend, replaced by v -v2 -b arm64/x64
1 parent 6b8a901 commit a7912e4

108 files changed

Lines changed: 83 additions & 15220 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/tools/builders/native_builder.v

Lines changed: 0 additions & 7 deletions
This file was deleted.

cmd/tools/changelog_helper.v

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ enum Category {
1515
web
1616
orm
1717
db
18-
native
1918
cgen
2019
js_backend
2120
comptime
@@ -47,8 +46,6 @@ const category_titles = '#### Improvements in the language
4746
4847
#### Database drivers
4948
50-
#### Native backend
51-
5249
#### C backend
5350
5451
#### JavaScript backend
@@ -195,8 +192,6 @@ fn (mut app App) process_line(text string) ! {
195192
category = .compiler_internals
196193
} else if is_improvements(text) {
197194
category = .improvements
198-
} else if is_native(text) {
199-
category = .native
200195
} else if is_vfmt(text) {
201196
category = .vfmt
202197
} else if text.contains('docs:') || text.contains('doc:') {
@@ -297,7 +292,6 @@ const category_map = {
297292
.web: '#### Web'
298293
.orm: '#### ORM'
299294
.db: '#### Database drivers'
300-
.native: '#### Native backend'
301295
.cgen: '#### C backend'
302296
.js_backend: '#### JavaScript backend'
303297
.comptime: '#### Comptime'
@@ -326,7 +320,7 @@ fn (l Line) write_at_category(txt string) ?string {
326320
// Trim "prefix:" for some categories
327321
// mut capitalized := false
328322
mut has_prefix := true
329-
if l.category in [.cgen, .checker, .improvements, .native, .orm, .interpreter] {
323+
if l.category in [.cgen, .checker, .improvements, .orm, .interpreter] {
330324
has_prefix = false
331325
if semicolon_pos := line_text.index(': ') {
332326
prefix := line_text[..semicolon_pos]
@@ -545,14 +539,6 @@ fn is_web(text string) bool {
545539
return is_xxx(text, web_strings)
546540
}
547541

548-
const native_strings = [
549-
'native:',
550-
]
551-
552-
fn is_native(text string) bool {
553-
return is_xxx(text, native_strings)
554-
}
555-
556542
const vfmt_strings = [
557543
'vfmt:',
558544
'fmt:',

cmd/tools/vtest-all.v

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ const vargs = args_string.all_before('test-all')
2020

2121
const vtest_nocleanup = os.getenv('VTEST_NOCLEANUP').bool()
2222

23-
const hw_native_no_builtin_size_limit = 300
24-
2523
const l2w_crosscc = os.find_abs_path_of_executable('x86_64-w64-mingw32-gcc-win32') or { '' }
2624

2725
const clang_path = os.find_abs_path_of_executable('clang') or { '' }
@@ -189,48 +187,6 @@ fn get_all_commands() []Command {
189187
line: '${vexe} run examples/v_script.vsh > /dev/null'
190188
okmsg: 'V can run the .VSH script file examples/v_script.vsh'
191189
}
192-
// Note: -experimental is used here, just to suppress the warnings,
193-
// that are otherwise printed by the native backend,
194-
// until globals and hash statements *are implemented*:
195-
$if linux {
196-
res << Command{
197-
line: '${vexe} -experimental -b native run examples/native/hello_world.v > /dev/null'
198-
okmsg: 'V compiles and runs examples/native/hello_world.v on the native backend for linux'
199-
}
200-
res << Command{
201-
line: '${vexe} -no-builtin -experimental -b native examples/hello_world.v > /dev/null'
202-
okmsg: 'V compiles examples/hello_world.v on the native backend for linux with `-no-builtin` & the executable is <= ${hw_native_no_builtin_size_limit} bytes'
203-
rmfile: 'examples/hello_world'
204-
after_cb: fn () ! {
205-
file := 'examples/hello_world'
206-
if !os.exists(file) {
207-
return error('>> file ${file} does not exist')
208-
}
209-
if os.file_size(file) > hw_native_no_builtin_size_limit {
210-
return error('>> file ${file} bigger than ${hw_native_no_builtin_size_limit} bytes')
211-
}
212-
}
213-
}
214-
}
215-
// only compilation:
216-
res << Command{
217-
line: '${vexe} -os linux -experimental -b native -o hw.linux examples/hello_world.v'
218-
okmsg: 'V compiles hello_world.v on the native backend for linux'
219-
rmfile: ['hw.linux', 'hw.linux.o']
220-
}
221-
res << Command{
222-
line: '${vexe} -os macos -experimental -b native -o hw.macos examples/hello_world.v'
223-
okmsg: 'V compiles hello_world.v on the native backend for macos'
224-
rmfile: ['hw.macos', 'hw.macos.o']
225-
}
226-
$if windows {
227-
res << Command{
228-
line: '${vexe} -os windows -experimental -b native -o hw.exe examples/hello_world.v'
229-
okmsg: 'V compiles hello_world.v on the native backend for windows'
230-
rmfile: ['hw.exe', 'hw.o']
231-
}
232-
}
233-
//
234190
res << Command{
235191
line: '${vexe} -b js -o hw.js examples/hello_world.v'
236192
okmsg: 'V compiles hello_world.v on the JS backend'

cmd/v/v.v

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,6 @@ fn rebuild(prefs &pref.Preferences) {
290290
.js_node, .js_freestanding, .js_browser {
291291
util.launch_tool(prefs.is_verbose, 'builders/js_builder', os.args[1..])
292292
}
293-
.native {
294-
util.launch_tool(prefs.is_verbose, 'builders/native_builder', os.args[1..])
295-
}
296293
.interpret {
297294
util.launch_tool(prefs.is_verbose, 'builders/interpret_builder', os.args[1..])
298295
}

examples/native/hello_world.v

Lines changed: 0 additions & 18 deletions
This file was deleted.

vlib/builtin/allocation.c.v

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ pub fn malloc_noscan(n isize) &u8 {
9191
_memory_panic(@FN, n)
9292
}
9393
mut res := &u8(unsafe { nil })
94-
$if native {
95-
res = unsafe { C.malloc(n) }
96-
} $else $if prealloc {
94+
$if prealloc {
9795
return unsafe { prealloc_malloc(n) }
9896
} $else $if vgc ? {
9997
unsafe {
@@ -325,8 +323,6 @@ pub fn vcalloc(n isize) &u8 {
325323
}
326324
$if prealloc {
327325
return unsafe { prealloc_calloc(n) }
328-
} $else $if native {
329-
return unsafe { C.calloc(1, n) }
330326
} $else $if vgc ? {
331327
return unsafe { &u8(vgc_calloc(usize(n))) }
332328
} $else $if gcboehm ? {

vlib/builtin/backtraces.c.v

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ pub fn print_backtrace() {
1010
$if !no_backtrace ? {
1111
$if freestanding {
1212
println(bare_backtrace())
13-
} $else $if native {
14-
// TODO: native backtrace solution
1513
} $else $if tinyc {
1614
C.tcc_backtrace(c'Backtrace')
1715
} $else $if use_libbacktrace ? {

vlib/builtin/backtraces_nix.c.v

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,7 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
165165
eprintln('On Android no backtrace is available.')
166166
return false
167167
}
168-
$if native {
169-
eprintln('native backend does not support backtraces yet.')
170-
return false
171-
} $else $if no_backtrace ? {
168+
$if no_backtrace ? {
172169
return false
173170
} $else {
174171
$if linux && !freestanding {

vlib/builtin/backtraces_windows.c.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn print_backtrace_skipping_top_frames_mingw(skipframes int) bool {
160160
fn C.tcc_backtrace(fmt &char) i32
161161

162162
fn print_backtrace_skipping_top_frames_tcc(skipframes int) bool {
163-
$if tinyc && !native {
163+
$if tinyc {
164164
$if no_backtrace ? {
165165
eprintln('backtraces are disabled')
166166
return false

vlib/builtin/float.c.v

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ $if !nofloat ? {
66
import strconv
77
}
88

9-
$if !native {
10-
#include <float.h>
11-
}
9+
#include <float.h>
1210

1311
// str returns a string representation of the given `f64` in a suitable notation.
1412
@[inline]
@@ -198,18 +196,10 @@ pub fn f64_max(a f64, b f64) f64 {
198196
pub fn (a f32) eq_epsilon(b f32) bool {
199197
hi := f32_max(f32_abs(a), f32_abs(b))
200198
delta := f32_abs(a - b)
201-
$if native {
202-
if hi > f32(1.0) {
203-
return delta <= hi * (4 * 1.19209290e-7)
204-
} else {
205-
return (1 / (4 * 1.19209290e-7)) * delta <= hi
206-
}
207-
} $else {
208-
if hi > f32(1.0) {
209-
return delta <= hi * (4 * f32(C.FLT_EPSILON))
210-
} else {
211-
return (1 / (4 * f32(C.FLT_EPSILON))) * delta <= hi
212-
}
199+
if hi > f32(1.0) {
200+
return delta <= hi * (4 * f32(C.FLT_EPSILON))
201+
} else {
202+
return (1 / (4 * f32(C.FLT_EPSILON))) * delta <= hi
213203
}
214204
}
215205

@@ -220,17 +210,9 @@ pub fn (a f32) eq_epsilon(b f32) bool {
220210
pub fn (a f64) eq_epsilon(b f64) bool {
221211
hi := f64_max(f64_abs(a), f64_abs(b))
222212
delta := f64_abs(a - b)
223-
$if native {
224-
if hi > 1.0 {
225-
return delta <= hi * (4 * 2.2204460492503131e-16)
226-
} else {
227-
return (1 / (4 * 2.2204460492503131e-16)) * delta <= hi
228-
}
229-
} $else {
230-
if hi > 1.0 {
231-
return delta <= hi * (4 * f64(C.DBL_EPSILON))
232-
} else {
233-
return (1 / (4 * f64(C.DBL_EPSILON))) * delta <= hi
234-
}
213+
if hi > 1.0 {
214+
return delta <= hi * (4 * f64(C.DBL_EPSILON))
215+
} else {
216+
return (1 / (4 * f64(C.DBL_EPSILON))) * delta <= hi
235217
}
236218
}

0 commit comments

Comments
 (0)