Commit a494b29c authored by Damien George's avatar Damien George
Browse files

Merge pull request #73 from mikaeleiman/apple-clang-fixes

Apple clang fixes
parents 71c5181a d6709137
...@@ -5,9 +5,14 @@ ...@@ -5,9 +5,14 @@
.text .text
/* uint nlr_push(rdi=nlr_buf_t *nlr) */ /* uint nlr_push(rdi=nlr_buf_t *nlr) */
#ifndef __apple_build_version__
.globl nlr_push .globl nlr_push
.type nlr_push, @function .type nlr_push, @function
nlr_push: nlr_push:
#else
.globl _nlr_push
_nlr_push:
#endif
movq (%rsp), %rax # load return %rip movq (%rsp), %rax # load return %rip
movq %rax, 16(%rdi) # store %rip into nlr_buf movq %rax, 16(%rdi) # store %rip into nlr_buf
movq %rbp, 24(%rdi) # store %rbp into nlr_buf movq %rbp, 24(%rdi) # store %rbp into nlr_buf
...@@ -22,22 +27,36 @@ nlr_push: ...@@ -22,22 +27,36 @@ nlr_push:
movq %rdi, nlr_top(%rip) # stor new nlr_buf (to make linked list) movq %rdi, nlr_top(%rip) # stor new nlr_buf (to make linked list)
xorq %rax, %rax # return 0, normal return xorq %rax, %rax # return 0, normal return
ret # return ret # return
#ifndef __apple_build_version__
.size nlr_push, .-nlr_push .size nlr_push, .-nlr_push
#endif
/* void nlr_pop() */ /* void nlr_pop() */
#ifndef __apple_build_version__
.globl nlr_pop .globl nlr_pop
.type nlr_pop, @function .type nlr_pop, @function
nlr_pop: nlr_pop:
#else
.globl _nlr_pop
_nlr_pop:
#endif
movq nlr_top(%rip), %rax # get nlr_top into %rax movq nlr_top(%rip), %rax # get nlr_top into %rax
movq (%rax), %rax # load prev nlr_buf movq (%rax), %rax # load prev nlr_buf
movq %rax, nlr_top(%rip) # store prev nlr_buf (to unlink list) movq %rax, nlr_top(%rip) # store prev nlr_buf (to unlink list)
ret # return ret # return
#ifndef __apple_build_version__
.size nlr_pop, .-nlr_pop .size nlr_pop, .-nlr_pop
#endif
/* void nlr_jump(rdi=uint val) */ /* void nlr_jump(rdi=uint val) */
#ifndef __apple_build_version__
.globl nlr_jump .globl nlr_jump
.type nlr_jump, @function .type nlr_jump, @function
nlr_jump: nlr_jump:
#else
.globl _nlr_jump
_nlr_jump:
#endif
movq %rdi, %rax # put return value in %rax movq %rdi, %rax # put return value in %rax
movq nlr_top(%rip), %rdi # get nlr_top into %rdi movq nlr_top(%rip), %rdi # get nlr_top into %rdi
movq %rax, 8(%rdi) # store return value movq %rax, 8(%rdi) # store return value
...@@ -55,8 +74,12 @@ nlr_jump: ...@@ -55,8 +74,12 @@ nlr_jump:
xorq %rax, %rax # clear return register xorq %rax, %rax # clear return register
inc %al # increase to make 1, non-local return inc %al # increase to make 1, non-local return
ret # return ret # return
#ifndef __apple_build_version__
.size nlr_jump, .-nlr_jump .size nlr_jump, .-nlr_jump
#endif
#ifndef __apple_build_version__
.local nlr_top .local nlr_top
#endif
.comm nlr_top,8,8 .comm nlr_top,8,8
#endif #endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment