[pypy-svn] r16489 - pypy/dist/pypy/translator/llvm2/module
ericvrp at codespeak.net
ericvrp at codespeak.net
Thu Aug 25 15:14:28 CEST 2005
Author: ericvrp
Date: Thu Aug 25 15:14:26 2005
New Revision: 16489
Modified:
pypy/dist/pypy/translator/llvm2/module/extfunction.py
pypy/dist/pypy/translator/llvm2/module/ll_math.py
pypy/dist/pypy/translator/llvm2/module/ll_os.py
pypy/dist/pypy/translator/llvm2/module/ll_strtod.py
pypy/dist/pypy/translator/llvm2/module/ll_time.py
pypy/dist/pypy/translator/llvm2/module/support.py
Log:
* removed UINT and INT's (no longer used)
* added DEFAULT_INTERNAL usage
Modified: pypy/dist/pypy/translator/llvm2/module/extfunction.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/extfunction.py (original)
+++ pypy/dist/pypy/translator/llvm2/module/extfunction.py Thu Aug 25 15:14:26 2005
@@ -1,40 +1,43 @@
+import py
+from pypy.translator.llvm2.codewriter import DEFAULT_INTERNAL, DEFAULT_CCONV
+
extdeclarations = """;rpython stuff
;gc-type dependent mallocs
-declare fastcc sbyte* %gc_malloc(UINT)
-declare fastcc sbyte* %gc_malloc_atomic(UINT)
+declare %(DEFAULT_CCONV)s sbyte* %%gc_malloc(uint)
+declare %(DEFAULT_CCONV)s sbyte* %%gc_malloc_atomic(uint)
;exception handling globals
-%last_exception_type = global %RPYTHON_EXCEPTION_VTABLE* null
-%last_exception_value = global %RPYTHON_EXCEPTION* null
-"""
-
-gc_boehm = """declare ccc sbyte* %GC_malloc(UINT)
-declare ccc sbyte* %GC_malloc_atomic(UINT)
-
-internal fastcc sbyte* %gc_malloc(UINT %n) {
- %ptr = call ccc sbyte* %GC_malloc(UINT %n)
- ret sbyte* %ptr
+%%last_exception_type = global %%RPYTHON_EXCEPTION_VTABLE* null
+%%last_exception_value = global %%RPYTHON_EXCEPTION* null
+""" % locals()
+
+gc_boehm = """declare ccc sbyte* %%GC_malloc(uint)
+declare ccc sbyte* %%GC_malloc_atomic(uint)
+
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s sbyte* %%gc_malloc(uint %%n) {
+ %%ptr = call ccc sbyte* %%GC_malloc(uint %%n)
+ ret sbyte* %%ptr
}
-internal fastcc sbyte* %gc_malloc_atomic(UINT %n) {
- %ptr = call ccc sbyte* %GC_malloc_atomic(UINT %n)
- ret sbyte* %ptr
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s sbyte* %%gc_malloc_atomic(uint %%n) {
+ %%ptr = call ccc sbyte* %%GC_malloc_atomic(uint %%n)
+ ret sbyte* %%ptr
}
-"""
+""" % locals()
-gc_disabled = """internal fastcc sbyte* %gc_malloc(UINT %n) {
- %nn = cast UINT %n to uint
- %ptr = malloc sbyte, uint %nn
- ret sbyte* %ptr
+gc_disabled = """%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s sbyte* %%gc_malloc(uint %%n) {
+ %%nn = cast uint %%n to uint
+ %%ptr = malloc sbyte, uint %%nn
+ ret sbyte* %%ptr
}
-internal fastcc sbyte* %gc_malloc_atomic(UINT %n) {
- %nn = cast UINT %n to uint
- %ptr = malloc sbyte, uint %nn
- ret sbyte* %ptr
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s sbyte* %%gc_malloc_atomic(uint %%n) {
+ %%nn = cast uint %%n to uint
+ %%ptr = malloc sbyte, uint %%nn
+ ret sbyte* %%ptr
}
-"""
+""" % locals()
extfunctions = {} #dependencies, llvm-code
Modified: pypy/dist/pypy/translator/llvm2/module/ll_math.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/ll_math.py (original)
+++ pypy/dist/pypy/translator/llvm2/module/ll_math.py Thu Aug 25 15:14:26 2005
@@ -19,11 +19,11 @@
declare ccc double %atan2(double,double)
declare ccc double %fmod(double,double)
-%__ll_math_frexp = internal constant [12 x sbyte] c"frexp......\\00"
-%__ll_math_hypot = internal constant [12 x sbyte] c"hypot......\\00"
-%__ll_math_ldexp = internal constant [12 x sbyte] c"ldexp......\\00"
-%__ll_math_modf = internal constant [12 x sbyte] c"modf.......\\00"
-%__ll_math_pow = internal constant [12 x sbyte] c"pow........\\00"
+%__ll_math_frexp = constant [12 x sbyte] c"frexp......\\00"
+%__ll_math_hypot = constant [12 x sbyte] c"hypot......\\00"
+%__ll_math_ldexp = constant [12 x sbyte] c"ldexp......\\00"
+%__ll_math_modf = constant [12 x sbyte] c"modf.......\\00"
+%__ll_math_pow = constant [12 x sbyte] c"pow........\\00"
"""
extfunctions = {}
@@ -36,7 +36,7 @@
]
simple_function_template = """
-internal fastcc double %%ll_math_%(function)s(%(params)s) {
+ccc double %%ll_math_%(function)s(%(params)s) {
%%t = call ccc double %%%(function)s(%(params)s)
ret double %%t
}
@@ -48,29 +48,29 @@
extfunctions["%ll_math_" + function] = ((), simple_function_template % locals())
extfunctions["%ll_math_hypot"] = (("%__debug",), """
-internal fastcc double %ll_math_hypot(double %x, double %y) {
- call fastcc void %__debug([12 x sbyte]* %__ll_math_hypot) ; XXX: TODO: ll_math_hypot
+ccc double %ll_math_hypot(double %x, double %y) {
+ call ccc void %__debug([12 x sbyte]* %__ll_math_hypot) ; XXX: TODO: ll_math_hypot
ret double 0.0
}
""")
extfunctions["%ll_math_ldexp"] = (("%__debug",), """
-internal fastcc double %ll_math_ldexp(double %x, INT %y) {
- call fastcc void %__debug([12 x sbyte]* %__ll_math_ldexp) ; XXX: TODO: ll_math_ldexp
+ccc double %ll_math_ldexp(double %x, int %y) {
+ call ccc void %__debug([12 x sbyte]* %__ll_math_ldexp) ; XXX: TODO: ll_math_ldexp
ret double 0.0
}
""")
extfunctions["%ll_math_modf"] = (("%__debug",), """
-internal fastcc %RPyMODF_RESULT* %ll_math_modf(double %x) {
- call fastcc void %__debug([12 x sbyte]* %__ll_math_modf) ; XXX: TODO: ll_math_modf
+ccc %RPyMODF_RESULT* %ll_math_modf(double %x) {
+ call ccc void %__debug([12 x sbyte]* %__ll_math_modf) ; XXX: TODO: ll_math_modf
ret %RPyMODF_RESULT* null
}
""")
extfunctions["%ll_math_pow"] = (("%__debug",), """
-internal fastcc double %ll_math_pow(double %x, double %y) {
- call fastcc void %__debug([12 x sbyte]* %__ll_math_pow) ; XXX: TODO: ll_math_pow
+ccc double %ll_math_pow(double %x, double %y) {
+ call ccc void %__debug([12 x sbyte]* %__ll_math_pow) ; XXX: TODO: ll_math_pow
ret double 0.0
}
""")
Modified: pypy/dist/pypy/translator/llvm2/module/ll_os.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/ll_os.py (original)
+++ pypy/dist/pypy/translator/llvm2/module/ll_os.py Thu Aug 25 15:14:26 2005
@@ -1,150 +1,160 @@
extdeclarations = """
;ll_os.py
-declare ccc INT %dup(INT)
-declare ccc void %close(INT)
-declare ccc INT %open(sbyte*, INT, INT)
-declare ccc INT %write(INT, sbyte*, INT)
-declare ccc INT %read(INT, sbyte*, INT)
-declare ccc sbyte* %strncpy(sbyte*, sbyte*, INT)
-declare ccc INT %isatty(INT)
-declare ccc INT %stat(sbyte*, [32 x INT]*)
-declare ccc INT %fstat(INT, [32 x INT]*)
-declare ccc INT %lseek(INT, INT, INT)
-declare ccc INT %ftruncate(INT, INT)
-declare ccc sbyte* %getcwd(sbyte*, INT)
-
-%errno = external global INT
-
-%__ll_os_getcwd = internal constant [12 x sbyte] c"getcwd.....\\00"
-%__ll_os_ftruncate = internal constant [12 x sbyte] c"ftruncate..\\00"
-%__ll_os_lseek = internal constant [12 x sbyte] c"lseek......\\00"
-%__ll_os_stat = internal constant [12 x sbyte] c"stat.......\\00"
-%__ll_os_fstat = internal constant [12 x sbyte] c"fstat......\\00"
+declare ccc int %system(sbyte*)
+declare ccc int %dup(int)
+declare ccc void %close(int)
+declare ccc int %open(sbyte*, int, int)
+declare ccc int %write(int, sbyte*, int)
+declare ccc int %read(int, sbyte*, int)
+declare ccc sbyte* %strncpy(sbyte*, sbyte*, int)
+declare ccc int %isatty(int)
+declare ccc int %stat(sbyte*, [32 x int]*)
+declare ccc int %fstat(int, [32 x int]*)
+declare ccc int %lseek(int, int, int)
+declare ccc int %ftruncate(int, int)
+declare ccc sbyte* %getcwd(sbyte*, int)
+
+%errno = external global int
+
+%__ll_os_getcwd = constant [12 x sbyte] c"getcwd.....\\00"
+%__ll_os_ftruncate = constant [12 x sbyte] c"ftruncate..\\00"
+%__ll_os_lseek = constant [12 x sbyte] c"lseek......\\00"
+%__ll_os_stat = constant [12 x sbyte] c"stat.......\\00"
+%__ll_os_fstat = constant [12 x sbyte] c"fstat......\\00"
"""
extfunctions = {}
+extfunctions["%ll_os_system"] = (("%cast",), """
+ccc int %ll_os_system(%RPyString* %structstring) {
+ %dest = call ccc sbyte* %cast(%RPyString* %structstring)
+ %ret = call ccc int %system(sbyte* %dest)
+ ret int %ret
+}
+
+""")
+
extfunctions["%ll_os_dup"] = ((), """
-internal fastcc INT %ll_os_dup(INT %fd) {
- %ret = call ccc INT %dup(INT %fd)
- ret INT %ret
+ccc int %ll_os_dup(int %fd) {
+ %ret = call ccc int %dup(int %fd)
+ ret int %ret
}
""")
extfunctions["%ll_os_getcwd"] = (("%string_to_RPyString", "%__debug"), """
-internal fastcc %RPyString* %ll_os_getcwd() {
+ccc %RPyString* %ll_os_getcwd() {
- call fastcc void %__debug([12 x sbyte]* %__ll_os_getcwd) ; XXX: Test: ll_os_getcwd
+ call ccc void %__debug([12 x sbyte]* %__ll_os_getcwd) ; XXX: Test: ll_os_getcwd
- %s = alloca sbyte, UINT 1024
- %res = call ccc sbyte* %getcwd(sbyte* %s, INT 1023)
+ %s = alloca sbyte, uint 1024
+ %res = call ccc sbyte* %getcwd(sbyte* %s, int 1023)
;if %res == null: raise...
- %cwd = call fastcc %RPyString* %string_to_RPyString(sbyte* %s)
+ %cwd = call ccc %RPyString* %string_to_RPyString(sbyte* %s)
ret %RPyString* %cwd
}
""")
extfunctions["%ll_os_close"] = ((), """
-internal fastcc void %ll_os_close(INT %fd) {
- call ccc void %close(INT %fd)
+ccc void %ll_os_close(int %fd) {
+ call ccc void %close(int %fd)
ret void
}
""")
extfunctions["%ll_os_open"] = (("%cast",), """
-internal fastcc INT %ll_os_open(%RPyString* %structstring, INT %flag, INT %mode) {
- %dest = call fastcc sbyte* %cast(%RPyString* %structstring)
- %fd = call ccc INT %open(sbyte* %dest, INT %flag, INT %mode)
- ret INT %fd
+ccc int %ll_os_open(%RPyString* %structstring, int %flag, int %mode) {
+ %dest = call ccc sbyte* %cast(%RPyString* %structstring)
+ %fd = call ccc int %open(sbyte* %dest, int %flag, int %mode)
+ ret int %fd
}
""")
extfunctions["%ll_os_write"] = (("%cast",), """
-internal fastcc INT %ll_os_write(INT %fd, %RPyString* %structstring) {
+ccc int %ll_os_write(int %fd, %RPyString* %structstring) {
%reallengthptr = getelementptr %RPyString* %structstring, int 0, uint 1, uint 0
- %reallength = load INT* %reallengthptr
- %dest = call fastcc sbyte* %cast(%RPyString* %structstring)
- %byteswritten = call ccc INT %write(INT %fd, sbyte* %dest, INT %reallength)
- ret INT %byteswritten
+ %reallength = load int* %reallengthptr
+ %dest = call ccc sbyte* %cast(%RPyString* %structstring)
+ %byteswritten = call ccc int %write(int %fd, sbyte* %dest, int %reallength)
+ ret int %byteswritten
}
""")
extfunctions["%ll_read_into"] = ((), """
-internal fastcc INT %ll_read_into(INT %fd, %RPyString* %structstring) {
+ccc int %ll_read_into(int %fd, %RPyString* %structstring) {
%reallengthptr = getelementptr %RPyString* %structstring, int 0, uint 1, uint 0
- %reallength = load INT* %reallengthptr
+ %reallength = load int* %reallengthptr
%destptr = getelementptr %RPyString* %structstring, int 0, uint 1, uint 1
%dest = cast [0 x sbyte]* %destptr to sbyte*
- %bytesread = call ccc INT %read(INT %fd, sbyte* %dest, INT %reallength)
- ret INT %bytesread
+ %bytesread = call ccc int %read(int %fd, sbyte* %dest, int %reallength)
+ ret int %bytesread
}
""")
extfunctions["%ll_os_isatty"] = ((), """
-internal fastcc bool %ll_os_isatty(INT %fd) {
- %ret = call ccc INT %isatty(INT %fd)
- %ret.bool = cast INT %ret to bool
+ccc bool %ll_os_isatty(int %fd) {
+ %ret = call ccc int %isatty(int %fd)
+ %ret.bool = cast int %ret to bool
ret bool %ret.bool
}
""")
extfunctions["%ll_os_ftruncate"] = (("%__debug",), """
-internal fastcc void %ll_os_ftruncate(INT %fd, INT %length) {
- call fastcc void %__debug([12 x sbyte]* %__ll_os_ftruncate) ; XXX: Test: ll_os_ftruncate
- %res = call ccc INT %ftruncate(INT %fd, INT %length)
+ccc void %ll_os_ftruncate(int %fd, int %length) {
+ call ccc void %__debug([12 x sbyte]* %__ll_os_ftruncate) ; XXX: Test: ll_os_ftruncate
+ %res = call ccc int %ftruncate(int %fd, int %length)
;if res < 0 raise...
ret void
}
""")
extfunctions["%ll_os_lseek"] = (("%__debug",), """
-internal fastcc INT %ll_os_lseek(INT %fd, INT %pos, INT %how) {
- call fastcc void %__debug([12 x sbyte]* %__ll_os_lseek) ; XXX: Test: ll_os_lseek
+ccc int %ll_os_lseek(int %fd, int %pos, int %how) {
+ call ccc void %__debug([12 x sbyte]* %__ll_os_lseek) ; XXX: Test: ll_os_lseek
;TODO: determine correct %how
- %res = call ccc INT %lseek(INT %fd, INT %pos, INT %how)
+ %res = call ccc int %lseek(int %fd, int %pos, int %how)
;if res < 0 raise...
- ret INT %res
+ ret int %res
}
""")
extfunctions["%_stat_construct_result_helper"] = ((), """
-internal fastcc %RPySTAT_RESULT* %_stat_construct_result_helper([32 x INT]* %src) {
+ccc %RPySTAT_RESULT* %_stat_construct_result_helper([32 x int]* %src) {
- %src0ptr = getelementptr [32 x INT]* %src, int 0, uint 4 ;st_mode
- %src1ptr = getelementptr [32 x INT]* %src, int 0, uint 3 ;st_ino
- %src2ptr = getelementptr [32 x INT]* %src, int 0, uint 0 ;st_dev
- %src3ptr = getelementptr [32 x INT]* %src, int 0, uint 5 ;st_nlink
- %src4ptr = getelementptr [32 x INT]* %src, int 0, uint 6 ;st_uid
- %src5ptr = getelementptr [32 x INT]* %src, int 0, uint 7 ;st_gid
- %src6ptr = getelementptr [32 x INT]* %src, int 0, uint 11 ;st_size
- %src7ptr = getelementptr [32 x INT]* %src, int 0, uint 14 ;st_atime
- %src8ptr = getelementptr [32 x INT]* %src, int 0, uint 16 ;st_mtime
- %src9ptr = getelementptr [32 x INT]* %src, int 0, uint 18 ;st_ctime
-
- %src0 = load INT* %src0ptr
- %src1 = load INT* %src1ptr
- %src2 = load INT* %src2ptr
- %src3 = load INT* %src3ptr
- %src4 = load INT* %src4ptr
- %src5 = load INT* %src5ptr
- %src6 = load INT* %src6ptr
- %src7 = load INT* %src7ptr
- %src8 = load INT* %src8ptr
- %src9 = load INT* %src9ptr
+ %src0ptr = getelementptr [32 x int]* %src, int 0, uint 4 ;st_mode
+ %src1ptr = getelementptr [32 x int]* %src, int 0, uint 3 ;st_ino
+ %src2ptr = getelementptr [32 x int]* %src, int 0, uint 0 ;st_dev
+ %src3ptr = getelementptr [32 x int]* %src, int 0, uint 5 ;st_nlink
+ %src4ptr = getelementptr [32 x int]* %src, int 0, uint 6 ;st_uid
+ %src5ptr = getelementptr [32 x int]* %src, int 0, uint 7 ;st_gid
+ %src6ptr = getelementptr [32 x int]* %src, int 0, uint 11 ;st_size
+ %src7ptr = getelementptr [32 x int]* %src, int 0, uint 14 ;st_atime
+ %src8ptr = getelementptr [32 x int]* %src, int 0, uint 16 ;st_mtime
+ %src9ptr = getelementptr [32 x int]* %src, int 0, uint 18 ;st_ctime
+
+ %src0 = load int* %src0ptr
+ %src1 = load int* %src1ptr
+ %src2 = load int* %src2ptr
+ %src3 = load int* %src3ptr
+ %src4 = load int* %src4ptr
+ %src5 = load int* %src5ptr
+ %src6 = load int* %src6ptr
+ %src7 = load int* %src7ptr
+ %src8 = load int* %src8ptr
+ %src9 = load int* %src9ptr
%malloc.Size = getelementptr %RPySTAT_RESULT* null, uint 1
- %malloc.SizeU = cast %RPySTAT_RESULT* %malloc.Size to UINT
- %malloc.Ptr = call fastcc sbyte* %gc_malloc_atomic(UINT %malloc.SizeU)
+ %malloc.SizeU = cast %RPySTAT_RESULT* %malloc.Size to uint
+ %malloc.Ptr = call ccc sbyte* %gc_malloc_atomic(uint %malloc.SizeU)
%dest = cast sbyte* %malloc.Ptr to %RPySTAT_RESULT*
%dest0ptr = getelementptr %RPySTAT_RESULT* %dest, int 0, uint 0
@@ -158,60 +168,60 @@
%dest8ptr = getelementptr %RPySTAT_RESULT* %dest, int 0, uint 8
%dest9ptr = getelementptr %RPySTAT_RESULT* %dest, int 0, uint 9
- store INT %src0, INT* %dest0ptr
- store INT %src1, INT* %dest1ptr
- store INT %src2, INT* %dest2ptr
- store INT %src3, INT* %dest3ptr
- store INT %src4, INT* %dest4ptr
- store INT %src5, INT* %dest5ptr
- store INT %src6, INT* %dest6ptr
- store INT %src7, INT* %dest7ptr
- store INT %src8, INT* %dest8ptr
- store INT %src9, INT* %dest9ptr
+ store int %src0, int* %dest0ptr
+ store int %src1, int* %dest1ptr
+ store int %src2, int* %dest2ptr
+ store int %src3, int* %dest3ptr
+ store int %src4, int* %dest4ptr
+ store int %src5, int* %dest5ptr
+ store int %src6, int* %dest6ptr
+ store int %src7, int* %dest7ptr
+ store int %src8, int* %dest8ptr
+ store int %src9, int* %dest9ptr
ret %RPySTAT_RESULT* %dest
}
""")
extfunctions["%ll_os_stat"] = (("%cast", "%__debug", "%_stat_construct_result_helper"), """
-internal fastcc %RPySTAT_RESULT* %ll_os_stat(%RPyString* %s) {
+ccc %RPySTAT_RESULT* %ll_os_stat(%RPyString* %s) {
- call fastcc void %__debug([12 x sbyte]* %__ll_os_stat) ; XXX: Test: ll_os_stat
+ call ccc void %__debug([12 x sbyte]* %__ll_os_stat) ; XXX: Test: ll_os_stat
- %st = alloca [32 x INT]
- %filename = call fastcc sbyte* %cast(%RPyString* %s)
- %error = call ccc INT %stat(sbyte* %filename, [32 x INT]* %st)
- %cond = seteq INT %error, 0
+ %st = alloca [32 x int]
+ %filename = call ccc sbyte* %cast(%RPyString* %s)
+ %error = call ccc int %stat(sbyte* %filename, [32 x int]* %st)
+ %cond = seteq int %error, 0
br bool %cond, label %cool, label %bwa
bwa:
- %errno_ = load INT* %errno
- call fastcc void %ll_raise_OSError__Signed(INT %errno_)
+ %errno_ = load int* %errno
+ call ccc void %ll_raise_OSError__Signed(int %errno_)
ret %RPySTAT_RESULT* null
cool:
- %result = call fastcc %RPySTAT_RESULT* %_stat_construct_result_helper([32 x INT]* %st)
+ %result = call ccc %RPySTAT_RESULT* %_stat_construct_result_helper([32 x int]* %st)
ret %RPySTAT_RESULT* %result
}
""")
extfunctions["%ll_os_fstat"] = (("%__debug", "%_stat_construct_result_helper"), """
-internal fastcc %RPySTAT_RESULT* %ll_os_fstat(INT %fd) {
+ccc %RPySTAT_RESULT* %ll_os_fstat(int %fd) {
- call fastcc void %__debug([12 x sbyte]* %__ll_os_fstat) ; XXX: Test: ll_os_fstat
+ call ccc void %__debug([12 x sbyte]* %__ll_os_fstat) ; XXX: Test: ll_os_fstat
- %st = alloca [32 x INT]
- %error = call ccc INT %fstat(INT %fd, [32 x INT]* %st)
- %cond = seteq INT %error, 0
+ %st = alloca [32 x int]
+ %error = call ccc int %fstat(int %fd, [32 x int]* %st)
+ %cond = seteq int %error, 0
br bool %cond, label %cool, label %bwa
bwa:
- %errno_ = load INT* %errno
- call fastcc void %ll_raise_OSError__Signed(INT %errno_)
+ %errno_ = load int* %errno
+ call ccc void %ll_raise_OSError__Signed(int %errno_)
ret %RPySTAT_RESULT* null
cool:
- %result = call fastcc %RPySTAT_RESULT* %_stat_construct_result_helper([32 x INT]* %st)
+ %result = call ccc %RPySTAT_RESULT* %_stat_construct_result_helper([32 x int]* %st)
ret %RPySTAT_RESULT* %result
}
Modified: pypy/dist/pypy/translator/llvm2/module/ll_strtod.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/ll_strtod.py (original)
+++ pypy/dist/pypy/translator/llvm2/module/ll_strtod.py Thu Aug 25 15:14:26 2005
@@ -1,21 +1,21 @@
extdeclarations = """
;ll_strtod.py
-%__ll_strtod_formatd = internal constant [12 x sbyte] c"formatd....\\00"
-%__ll_strtod_parts_to_float = internal constant [12 x sbyte] c"parts2flt..\\00"
+%__ll_strtod_formatd = constant [12 x sbyte] c"formatd....\\00"
+%__ll_strtod_parts_to_float = constant [12 x sbyte] c"parts2flt..\\00"
"""
extfunctions = {}
extfunctions["%ll_strtod_formatd"] = (("%__debug",), """
-internal fastcc %RPyString* %ll_strtod_formatd(%RPyString* %s, double %x) {
- call fastcc void %__debug([12 x sbyte]* %__ll_strtod_formatd) ; XXX: TODO: ll_strtod_formatd
+ccc %RPyString* %ll_strtod_formatd(%RPyString* %s, double %x) {
+ call ccc void %__debug([12 x sbyte]* %__ll_strtod_formatd) ; XXX: TODO: ll_strtod_formatd
ret %RPyString* null
}
""")
extfunctions["%ll_strtod_parts_to_float"] = (("%__debug",), """
-internal fastcc double %ll_strtod_parts_to_float(%RPyString* s0, %RPyString* s1, %RPyString* s2, %RPyString* s3) {
- call fastcc void %__debug([12 x sbyte]* %__ll_strtod_parts_to_float) ; XXX: TODO: ll_strtod_parts_to_float
+ccc double %ll_strtod_parts_to_float(%RPyString* s0, %RPyString* s1, %RPyString* s2, %RPyString* s3) {
+ call ccc void %__debug([12 x sbyte]* %__ll_strtod_parts_to_float) ; XXX: TODO: ll_strtod_parts_to_float
ret double 0.0
}
""")
Modified: pypy/dist/pypy/translator/llvm2/module/ll_time.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/ll_time.py (original)
+++ pypy/dist/pypy/translator/llvm2/module/ll_time.py Thu Aug 25 15:14:26 2005
@@ -1,81 +1,81 @@
extdeclarations = '''
;ll_time.py
-%struct.timeval = type { INT, INT }
-%struct.timezone = type { INT, INT }
-%typedef.fd_set = type { [32 x INT] }
+%struct.timeval = type { int, int }
+%struct.timezone = type { int, int }
+%typedef.fd_set = type { [32 x int] }
-%.str_xxx1 = internal constant [16 x sbyte] c"select() failed\\00" ; <[16 x sbyte]*> [#uses=1]
+%.str_xxx1 = constant [16 x sbyte] c"select() failed\\00" ; <[16 x sbyte]*> [#uses=1]
declare ccc double %floor(double)
declare ccc double %fmod(double, double)
-declare ccc INT %clock()
-declare ccc INT %select(INT, %typedef.fd_set*, %typedef.fd_set*, %typedef.fd_set*, %struct.timeval*)
-declare ccc INT %gettimeofday(%struct.timeval*, %struct.timeval*)
-declare ccc INT %time( INT* )
+declare ccc int %clock()
+declare ccc int %select(int, %typedef.fd_set*, %typedef.fd_set*, %typedef.fd_set*, %struct.timeval*)
+declare ccc int %gettimeofday(%struct.timeval*, %struct.timeval*)
+declare ccc int %time( int* )
'''
extfunctions = {}
extfunctions["%ll_time_time"] = ((), """
-internal fastcc double %ll_time_time() {
+ccc double %ll_time_time() {
%t = alloca %struct.timeval ; <%struct.timeval*> [#uses=3]
- %secs = alloca INT ; <int*> [#uses=2]
- %tmp.0 = call INT %gettimeofday( %struct.timeval* %t, %struct.timeval* null ) ; <int> [#uses=1]
- %tmp.1 = seteq INT %tmp.0, 0 ; <bool> [#uses=2]
- %tmp.2 = cast bool %tmp.1 to INT ; <int> [#uses=0]
+ %secs = alloca int ; <int*> [#uses=2]
+ %tmp.0 = call int %gettimeofday( %struct.timeval* %t, %struct.timeval* null ) ; <int> [#uses=1]
+ %tmp.1 = seteq int %tmp.0, 0 ; <bool> [#uses=2]
+ %tmp.2 = cast bool %tmp.1 to int ; <int> [#uses=0]
br bool %tmp.1, label %then, label %endif
then: ; preds = %entry
%tmp.3 = getelementptr %struct.timeval* %t, int 0, uint 0 ; <int*> [#uses=1]
- %tmp.4 = load INT* %tmp.3 ; <int> [#uses=1]
- %tmp.5 = cast INT %tmp.4 to double ; <double> [#uses=1]
+ %tmp.4 = load int* %tmp.3 ; <int> [#uses=1]
+ %tmp.5 = cast int %tmp.4 to double ; <double> [#uses=1]
%tmp.6 = getelementptr %struct.timeval* %t, int 0, uint 1 ; <int*> [#uses=1]
- %tmp.7 = load INT* %tmp.6 ; <int> [#uses=1]
- %tmp.8 = cast INT %tmp.7 to double ; <double> [#uses=1]
+ %tmp.7 = load int* %tmp.6 ; <int> [#uses=1]
+ %tmp.8 = cast int %tmp.7 to double ; <double> [#uses=1]
%tmp.9 = mul double %tmp.8, 1.000000e-06 ; <double> [#uses=1]
%tmp.10 = add double %tmp.5, %tmp.9 ; <double> [#uses=1]
ret double %tmp.10
endif: ; preds = %entry
- %tmp.11 = call INT %time( INT* %secs ) ; <int> [#uses=0]
- %tmp.12 = load INT* %secs ; <int> [#uses=1]
- %tmp.13 = cast INT %tmp.12 to double ; <double> [#uses=1]
+ %tmp.11 = call int %time( int* %secs ) ; <int> [#uses=0]
+ %tmp.12 = load int* %secs ; <int> [#uses=1]
+ %tmp.13 = cast int %tmp.12 to double ; <double> [#uses=1]
ret double %tmp.13
}
""")
extfunctions["%ll_time_clock"] = ((), """
-internal fastcc double %ll_time_clock() {
+ccc double %ll_time_clock() {
entry:
- %tmp.0 = call INT %clock( ) ; <int> [#uses=1]
- %tmp.1 = cast INT %tmp.0 to double ; <double> [#uses=1]
+ %tmp.0 = call int %clock( ) ; <int> [#uses=1]
+ %tmp.1 = cast int %tmp.0 to double ; <double> [#uses=1]
%tmp.2 = div double %tmp.1, 1.000000e+06 ; <double> [#uses=1]
ret double %tmp.2
}
""")
extfunctions["%ll_time_sleep"] = ((), """
-internal fastcc void %ll_time_sleep(double %secs) {
+ccc void %ll_time_sleep(double %secs) {
entry:
%t = alloca %struct.timeval ; <%struct.timeval*> [#uses=3]
%tmp.0 = call double %fmod( double %secs, double 1.000000e+00 ) ; <double> [#uses=1]
%tmp.2 = call double %floor( double %secs ) ; <double> [#uses=1]
%tmp.4 = getelementptr %struct.timeval* %t, int 0, uint 0 ; <int*> [#uses=1]
- %tmp.6 = cast double %tmp.2 to INT ; <int> [#uses=1]
- store INT %tmp.6, INT* %tmp.4
+ %tmp.6 = cast double %tmp.2 to int ; <int> [#uses=1]
+ store int %tmp.6, int* %tmp.4
%tmp.7 = getelementptr %struct.timeval* %t, int 0, uint 1 ; <int*> [#uses=1]
%tmp.9 = mul double %tmp.0, 1.000000e+06 ; <double> [#uses=1]
- %tmp.10 = cast double %tmp.9 to INT ; <int> [#uses=1]
- store INT %tmp.10, INT* %tmp.7
- %tmp.11 = call INT %select( INT 0, %typedef.fd_set* null, %typedef.fd_set* null, %typedef.fd_set* null, %struct.timeval* %t ) ; <int> [#uses=1]
- %tmp.12 = setne INT %tmp.11, 0 ; <bool> [#uses=2]
- %tmp.13 = cast bool %tmp.12 to INT ; <int> [#uses=0]
+ %tmp.10 = cast double %tmp.9 to int ; <int> [#uses=1]
+ store int %tmp.10, int* %tmp.7
+ %tmp.11 = call int %select( int 0, %typedef.fd_set* null, %typedef.fd_set* null, %typedef.fd_set* null, %struct.timeval* %t ) ; <int> [#uses=1]
+ %tmp.12 = setne int %tmp.11, 0 ; <bool> [#uses=2]
+ %tmp.13 = cast bool %tmp.12 to int ; <int> [#uses=0]
br bool %tmp.12, label %then.1, label %return
then.1: ; preds = %entry
- ; XXX disabled for now: call void %RaiseSimpleException( INT 1, sbyte* getelementptr ([16 x sbyte]* %.str_xxx1, INT 0, INT 0) )
+ ; XXX disabled for now: call void %RaiseSimpleException( int 1, sbyte* getelementptr ([16 x sbyte]* %.str_xxx1, int 0, int 0) )
ret void
return: ; preds = %entry
Modified: pypy/dist/pypy/translator/llvm2/module/support.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/support.py (original)
+++ pypy/dist/pypy/translator/llvm2/module/support.py Thu Aug 25 15:14:26 2005
@@ -1,95 +1,98 @@
-extdeclarations = """
-declare ccc double %pow(double, double)
-declare ccc double %fmod(double, double)
-declare ccc INT %puts(sbyte*)
-declare ccc INT %strlen(sbyte*)
-declare ccc INT %strcmp(sbyte*, sbyte*)
-declare ccc sbyte* %memset(sbyte*, INT, UINT)
+import py
+from pypy.translator.llvm2.codewriter import DEFAULT_INTERNAL, DEFAULT_CCONV
-%__print_debug_info = internal global bool false
-%__print_debug_info_option = internal constant [19 x sbyte] c"--print-debug-info\\00"
-"""
+extdeclarations = """
+declare ccc double %%pow(double, double)
+declare ccc double %%fmod(double, double)
+declare ccc int %%puts(sbyte*)
+declare ccc int %%strlen(sbyte*)
+declare ccc int %%strcmp(sbyte*, sbyte*)
+declare ccc sbyte* %%memset(sbyte*, int, uint)
+
+%%__print_debug_info = %(DEFAULT_INTERNAL)s global bool false
+%%__print_debug_info_option = %(DEFAULT_INTERNAL)s constant [19 x sbyte] c"--print-debug-info\\00"
+""" % locals()
extfunctions = {}
extfunctions["%__debug"] = ((), """
-internal fastcc void %__debug([12 x sbyte]* %msg12) {
- %cond = load bool* %__print_debug_info
- br bool %cond, label %print_it, label %do_nothing
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s void %%__debug([12 x sbyte]* %%msg12) {
+ %%cond = load bool* %%__print_debug_info
+ br bool %%cond, label %%print_it, label %%do_nothing
do_nothing:
ret void
print_it:
- %msg = getelementptr [12 x sbyte]* %msg12, int 0, int 0
- call int %puts(sbyte* %msg)
+ %%msg = getelementptr [12 x sbyte]* %%msg12, int 0, int 0
+ call int %%puts(sbyte* %%msg)
ret void
}
-""")
+""" % locals())
extfunctions["%cast"] = (("%string_to_RPyString",), """
-internal fastcc sbyte* %cast(%RPyString* %structstring) {
- %source1ptr = getelementptr %RPyString* %structstring, int 0, uint 1, uint 1
- %source1 = cast [0 x sbyte]* %source1ptr to sbyte*
- ret sbyte* %source1
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s sbyte* %%cast(%%RPyString* %%structstring) {
+ %%source1ptr = getelementptr %%RPyString* %%structstring, int 0, uint 1, uint 1
+ %%source1 = cast [0 x sbyte]* %%source1ptr to sbyte*
+ ret sbyte* %%source1
}
-""")
+""" % locals())
extfunctions["%string_to_RPyString"] = ((), """
-internal fastcc %RPyString* %string_to_RPyString(sbyte* %s) {
- %len = call ccc INT %strlen(sbyte* %s)
- %rpy = call fastcc %RPyString* %RPyString_New__Signed(INT %len)
- %rpystrptr = getelementptr %RPyString* %rpy, int 0, uint 1, uint 1
- %rpystr = cast [0 x sbyte]* %rpystrptr to sbyte*
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s %%RPyString* %%string_to_RPyString(sbyte* %%s) {
+ %%len = call ccc int %%strlen(sbyte* %%s)
+ %%rpy = call %(DEFAULT_CCONV)s %%RPyString* %%RPyString_New__Signed(int %%len)
+ %%rpystrptr = getelementptr %%RPyString* %%rpy, int 0, uint 1, uint 1
+ %%rpystr = cast [0 x sbyte]* %%rpystrptr to sbyte*
- call ccc sbyte* %strncpy(sbyte* %rpystr, sbyte* %s, INT %len)
+ call ccc sbyte* %%strncpy(sbyte* %%rpystr, sbyte* %%s, int %%len)
- ret %RPyString* %rpy
+ ret %%RPyString* %%rpy
}
-""")
+""" % locals())
#abs functions
extfunctions["%int_abs"] = ((), """
-internal fastcc INT %int_abs(INT %x) {
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_abs(int %%x) {
block0:
- %cond1 = setge INT %x, 0
- br bool %cond1, label %return_block, label %block1
+ %%cond1 = setge int %%x, 0
+ br bool %%cond1, label %%return_block, label %%block1
block1:
- %x2 = sub INT 0, %x
- br label %return_block
+ %%x2 = sub int 0, %%x
+ br label %%return_block
return_block:
- %result = phi INT [%x, %block0], [%x2, %block1]
- ret INT %result
+ %%result = phi int [%%x, %%block0], [%%x2, %%block1]
+ ret int %%result
}
-""")
+""" % locals())
extfunctions["%float_abs"] = ((), """
-internal fastcc double %float_abs(double %x) {
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s double %%float_abs(double %%x) {
block0:
- %cond1 = setge double %x, 0.0
- br bool %cond1, label %return_block, label %block1
+ %%cond1 = setge double %%x, 0.0
+ br bool %%cond1, label %%return_block, label %%block1
block1:
- %x2 = sub double 0.0, %x
- br label %return_block
+ %%x2 = sub double 0.0, %%x
+ br label %%return_block
return_block:
- %result = phi double [%x, %block0], [%x2, %block1]
- ret double %result
+ %%result = phi double [%%x, %%block0], [%%x2, %%block1]
+ ret double %%result
}
-""")
+""" % locals())
#prepare exceptions
for exc in "ZeroDivisionError OverflowError ValueError".split(): #_ZER _OVF _VAL
extfunctions["%%__prepare_%(exc)s" % locals()] = ((), """
-internal fastcc void %%__prepare_%(exc)s() {
- %%exception_value = call fastcc %%RPYTHON_EXCEPTION* %%instantiate_%(exc)s()
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s void %%__prepare_%(exc)s() {
+ %%exception_value = call %(DEFAULT_CCONV)s %%RPYTHON_EXCEPTION* %%instantiate_%(exc)s()
%%tmp = getelementptr %%RPYTHON_EXCEPTION* %%exception_value, int 0, uint 0
%%exception_type = load %%RPYTHON_EXCEPTION_VTABLE** %%tmp
store %%RPYTHON_EXCEPTION_VTABLE* %%exception_type, %%RPYTHON_EXCEPTION_VTABLE** %%last_exception_type
@@ -101,9 +104,9 @@
#prepare exceptions
for exc in "ZeroDivisionError OverflowError ValueError".split(): #_ZER _OVF _VAL
extfunctions["%%prepare_and_raise_%(exc)s" % locals()] = ((), """
-internal fastcc void %%prepare_and_raise_%(exc)s(sbyte* %%msg) {
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s void %%prepare_and_raise_%(exc)s(sbyte* %%msg) {
;XXX %%msg not used right now!
- %%exception_value = call fastcc %%RPYTHON_EXCEPTION* %%instantiate_%(exc)s()
+ %%exception_value = call %(DEFAULT_CCONV)s %%RPYTHON_EXCEPTION* %%instantiate_%(exc)s()
%%tmp = getelementptr %%RPYTHON_EXCEPTION* %%exception_value, int 0, uint 0
%%exception_type = load %%RPYTHON_EXCEPTION_VTABLE** %%tmp
store %%RPYTHON_EXCEPTION_VTABLE* %%exception_type, %%RPYTHON_EXCEPTION_VTABLE** %%last_exception_type
@@ -119,36 +122,36 @@
%%cond = seteq %s %%y, 0
br bool %%cond, label %%is_0, label %%is_not_0
is_0:
- call fastcc void %%__prepare_ZeroDivisionError()
+ call %s void %%__prepare_ZeroDivisionError()
unwind
is_not_0:
"""
-int_zer_test = zer_test % ('int',)
-double_zer_test = zer_test % ('double',)
+int_zer_test = zer_test % ('int' , DEFAULT_CCONV)
+double_zer_test = zer_test % ('double', DEFAULT_CCONV)
#overflow: normal operation, ...if ((x) >= 0 || (x) != -(x)) OK else _OVF()
#note: XXX this hardcoded int32 minint value is used because of a pre llvm1.6 bug!
int_ovf_test = """
- %cond2 = setne INT %x, -2147483648
- br bool %cond2, label %return_block, label %ovf
+ %%cond2 = setne int %%x, -2147483648
+ br bool %%cond2, label %%return_block, label %%ovf
ovf:
- call fastcc void %__prepare_OverflowError()
+ call %(DEFAULT_CCONV)s void %%__prepare_OverflowError()
unwind
-"""
+""" % locals()
#binary with ZeroDivisionError only
for func_inst in "floordiv_zer:div mod_zer:rem".split():
func, inst = func_inst.split(':')
- for prefix_type_ in "int:INT uint:UINT".split():
+ for prefix_type_ in "int:int uint:uint".split():
prefix, type_ = prefix_type_.split(':')
- type_zer_test = zer_test % type_
+ type_zer_test = zer_test % (type_, DEFAULT_CCONV)
extfunctions["%%%(prefix)s_%(func)s" % locals()] = (("%__prepare_ZeroDivisionError",), """
-internal fastcc %(type_)s %%%(prefix)s_%(func)s(%(type_)s %%x, %(type_)s %%y) {
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s %(type_)s %%%(prefix)s_%(func)s(%(type_)s %%x, %(type_)s %%y) {
%(type_zer_test)s
%%z = %(inst)s %(type_)s %%x, %%y
ret %(type_)s %%z
@@ -160,26 +163,26 @@
#unary with OverflowError only
extfunctions["%int_neg_ovf"] = (("%__prepare_OverflowError",), """
-internal fastcc INT %%int_neg_ovf(INT %%x) {
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_neg_ovf(int %%x) {
block1:
- %%x2 = sub INT 0, %%x
+ %%x2 = sub int 0, %%x
%(int_ovf_test)s
return_block:
- ret INT %%x2
+ ret int %%x2
}
""" % locals())
extfunctions["%int_abs_ovf"] = (("%__prepare_OverflowError",), """
-internal fastcc INT %%int_abs_ovf(INT %%x) {
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_abs_ovf(int %%x) {
block0:
- %%cond1 = setge INT %%x, 0
+ %%cond1 = setge int %%x, 0
br bool %%cond1, label %%return_block, label %%block1
block1:
- %%x2 = sub INT 0, %%x
+ %%x2 = sub int 0, %%x
%(int_ovf_test)s
return_block:
- %%result = phi INT [%%x, %%block0], [%%x2, %%block1]
- ret INT %%result
+ %%result = phi int [%%x, %%block0], [%%x2, %%block1]
+ ret int %%result
}
""" % locals())
@@ -187,32 +190,32 @@
#binary with OverflowError only
extfunctions["%int_add_ovf"] = (("%__prepare_OverflowError",), """
-internal fastcc INT %%int_add_ovf(INT %%x, INT %%y) {
- %%t = add INT %%x, %%y
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_add_ovf(int %%x, int %%y) {
+ %%t = add int %%x, %%y
%(int_ovf_test)s
return_block:
; XXX: TEST int_add_ovf checking
- ret INT %%t
+ ret int %%t
}
""" % locals())
extfunctions["%int_sub_ovf"] = (("%__prepare_OverflowError",), """
-internal fastcc INT %%int_sub_ovf(INT %%x, INT %%y) {
- %%t = sub INT %%x, %%y
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_sub_ovf(int %%x, int %%y) {
+ %%t = sub int %%x, %%y
%(int_ovf_test)s
return_block:
; XXX: TEST int_sub_ovf checking
- ret INT %%t
+ ret int %%t
}
""" % locals())
extfunctions["%int_mul_ovf"] = (("%__prepare_OverflowError",), """
-internal fastcc INT %%int_mul_ovf(INT %%x, INT %%y) {
- %%t = mul INT %%x, %%y
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_mul_ovf(int %%x, int %%y) {
+ %%t = mul int %%x, %%y
%(int_ovf_test)s
return_block:
; XXX: TEST int_mul_ovf checking
- ret INT %%t
+ ret int %%t
}
""" % locals())
@@ -220,13 +223,13 @@
#binary with OverflowError and ValueError
extfunctions["%int_lshift_ovf_val"] = (("%__prepare_OverflowError","%__prepare_ValueError"), """
-internal fastcc INT %%int_lshift_ovf_val(INT %%x, INT %%y) {
- %%yu = cast INT %%y to ubyte
- %%t = shl INT %%x, ubyte %%yu
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_lshift_ovf_val(int %%x, int %%y) {
+ %%yu = cast int %%y to ubyte
+ %%t = shl int %%x, ubyte %%yu
%(int_ovf_test)s
return_block:
; XXX: TODO int_lshift_ovf_val checking VAL
- ret INT %%t
+ ret int %%t
}
""" % locals())
@@ -234,62 +237,62 @@
#binary with OverflowError and ZeroDivisionError
extfunctions["%int_floordiv_ovf_zer"] = (("%__prepare_OverflowError","%__prepare_ZeroDivisionError"), """
-internal fastcc INT %%int_floordiv_ovf_zer(INT %%x, INT %%y) {
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_floordiv_ovf_zer(int %%x, int %%y) {
%(int_zer_test)s
- %%t = div INT %%x, %%y
+ %%t = div int %%x, %%y
%(int_ovf_test)s
return_block:
; XXX: TEST int_floordiv_ovf_zer checking
- ret INT %%t
+ ret int %%t
}
""" % locals())
extfunctions["%int_mod_ovf_zer"] = (("%__prepare_OverflowError","%__prepare_ZeroDivisionError"), """
-internal fastcc INT %%int_mod_ovf_zer(INT %%x, INT %%y) {
+%(DEFAULT_INTERNAL)s %(DEFAULT_CCONV)s int %%int_mod_ovf_zer(int %%x, int %%y) {
%(int_zer_test)s
- %%t = rem INT %%x, %%y
+ %%t = rem int %%x, %%y
%(int_ovf_test)s
return_block:
; XXX: TEST int_mod_ovf_zer checking
- ret INT %%t
+ ret int %%t
}
""" % locals())
extfunctions["%main"] = (("%string_to_RPyString"), """
-INT %main(INT %argc, sbyte** %argv) {
+int %%main(int %%argc, sbyte** %%argv) {
entry:
- %pypy_argv = call fastcc %RPyListOfString* %ll_newlist__listPtrConst_Signed.2(INT 0)
- br label %no_exit
+ %%pypy_argv = call %(DEFAULT_CCONV)s %%RPyListOfString* %%ll_newlist__listPtrConst_Signed.2(int 0)
+ br label %%no_exit
no_exit:
- %indvar = phi UINT [ %indvar.next, %next_arg ], [ 0, %entry ]
- %i.0.0 = cast UINT %indvar to INT
- %tmp.8 = getelementptr sbyte** %argv, UINT %indvar
- %tmp.9 = load sbyte** %tmp.8
-
- %t = getelementptr [19 x sbyte]* %__print_debug_info_option, int 0, int 0
- %res = call ccc INT %strcmp(sbyte* %tmp.9, sbyte* %t)
- %cond = seteq INT %res, 0
- br bool %cond, label %debugging, label %not_debugging
+ %%indvar = phi uint [ %%indvar.next, %%next_arg ], [ 0, %%entry ]
+ %%i.0.0 = cast uint %%indvar to int
+ %%tmp.8 = getelementptr sbyte** %%argv, uint %%indvar
+ %%tmp.9 = load sbyte** %%tmp.8
+
+ %%t = getelementptr [19 x sbyte]* %%__print_debug_info_option, int 0, int 0
+ %%res = call ccc int %%strcmp(sbyte* %%tmp.9, sbyte* %%t)
+ %%cond = seteq int %%res, 0
+ br bool %%cond, label %%debugging, label %%not_debugging
debugging:
- store bool true, bool* %__print_debug_info
- br label %next_arg
+ store bool true, bool* %%__print_debug_info
+ br label %%next_arg
not_debugging:
- %rpy = call fastcc %RPyString* %string_to_RPyString(sbyte* %tmp.9)
- call fastcc void %ll_append__listPtr_rpy_stringPtr(%RPyListOfString* %pypy_argv, %RPyString* %rpy)
- br label %next_arg
+ %%rpy = call %(DEFAULT_CCONV)s %%RPyString* %%string_to_RPyString(sbyte* %%tmp.9)
+ call %(DEFAULT_CCONV)s void %%ll_append__listPtr_rpy_stringPtr(%%RPyListOfString* %%pypy_argv, %%RPyString* %%rpy)
+ br label %%next_arg
next_arg:
- %inc = add INT %i.0.0, 1
- %tmp.2 = setlt INT %inc, %argc
- %indvar.next = add UINT %indvar, 1
- br bool %tmp.2, label %no_exit, label %loopexit
+ %%inc = add int %%i.0.0, 1
+ %%tmp.2 = setlt int %%inc, %%argc
+ %%indvar.next = add uint %%indvar, 1
+ br bool %%tmp.2, label %%no_exit, label %%loopexit
loopexit:
- %ret = call fastcc INT %entry_point(%structtype.list* %pypy_argv)
- ret INT %ret
+ %%ret = call %(DEFAULT_CCONV)s int %%entry_point(%%structtype.list* %%pypy_argv)
+ ret int %%ret
}
-""")
+""" % locals())
More information about the Pypy-commit
mailing list