diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2015-04-05 23:30:42 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2015-04-05 23:30:42 +0000 |
commit | 93c73ebcbd73f5436d13ffc41f49a86fc062deb8 (patch) | |
tree | 10bf9fb3a1314fc8a1c3b963b4550960718384ad /llgo/third_party/gofrontend/libgo/runtime/runtime.c | |
parent | 7d39641c805bf3263ffb55a23ecf4bbfd37402c0 (diff) | |
download | bcm5719-llvm-93c73ebcbd73f5436d13ffc41f49a86fc062deb8.tar.gz bcm5719-llvm-93c73ebcbd73f5436d13ffc41f49a86fc062deb8.zip |
Roll gofrontend to a6e10414311a
This takes us to Go 1.4. Also includes a couple of changes to the test
suite, both in the runtime package:
- Disable TestSetPanicOnFault. We cannot support this scenario at all,
due to LLVM's lack of non-call exceptions.
- Tweak TestFinalizerType. This test only passes with two GC runs.
Differential Revision: http://reviews.llvm.org/D8828
llvm-svn: 234134
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/runtime/runtime.c')
-rw-r--r-- | llgo/third_party/gofrontend/libgo/runtime/runtime.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/llgo/third_party/gofrontend/libgo/runtime/runtime.c b/llgo/third_party/gofrontend/libgo/runtime/runtime.c index 496e77b75c5..6e0d164707d 100644 --- a/llgo/third_party/gofrontend/libgo/runtime/runtime.c +++ b/llgo/third_party/gofrontend/libgo/runtime/runtime.c @@ -59,8 +59,8 @@ runtime_gotraceback(bool *crash) static int32 argc; static byte** argv; -extern Slice os_Args __asm__ (GOSYM_PREFIX "os.Args"); -extern Slice syscall_Envs __asm__ (GOSYM_PREFIX "syscall.Envs"); +static Slice args; +Slice envs; void (*runtime_sysargs)(int32, uint8**); @@ -92,9 +92,9 @@ runtime_goargs(void) s = runtime_malloc(argc*sizeof s[0]); for(i=0; i<argc; i++) s[i] = runtime_gostringnocopy((const byte*)argv[i]); - os_Args.__values = (void*)s; - os_Args.__count = argc; - os_Args.__capacity = argc; + args.__values = (void*)s; + args.__count = argc; + args.__capacity = argc; } void @@ -109,9 +109,26 @@ runtime_goenvs_unix(void) s = runtime_malloc(n*sizeof s[0]); for(i=0; i<n; i++) s[i] = runtime_gostringnocopy(argv[argc+1+i]); - syscall_Envs.__values = (void*)s; - syscall_Envs.__count = n; - syscall_Envs.__capacity = n; + envs.__values = (void*)s; + envs.__count = n; + envs.__capacity = n; +} + +// Called from the syscall package. +Slice runtime_envs(void) __asm__ (GOSYM_PREFIX "syscall.runtime_envs"); + +Slice +runtime_envs() +{ + return envs; +} + +Slice os_runtime_args(void) __asm__ (GOSYM_PREFIX "os.runtime_args"); + +Slice +os_runtime_args() +{ + return args; } int32 @@ -127,8 +144,8 @@ runtime_atoi(const byte *p) static struct root_list runtime_roots = { nil, - { { &syscall_Envs, sizeof syscall_Envs }, - { &os_Args, sizeof os_Args }, + { { &envs, sizeof envs }, + { &args, sizeof args }, { nil, 0 } }, }; |