Python files compatible with python 3
This commit is contained in:
@@ -26,17 +26,20 @@ if platform.system() == 'Windows' or string.find(platform.system(), "CYGWIN_NT")
|
|||||||
try:
|
try:
|
||||||
as_out=subprocess.Popen([llvm_as, "-", "-o", "-"], stdout=subprocess.PIPE)
|
as_out=subprocess.Popen([llvm_as, "-", "-o", "-"], stdout=subprocess.PIPE)
|
||||||
except IOError:
|
except IOError:
|
||||||
print >> sys.stderr, "Couldn't open " + src
|
print("Couldn't open " + src, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print "unsigned char builtins_bitcode_" + target + "[] = {"
|
print("unsigned char builtins_bitcode_" + target + "[] = {")
|
||||||
|
num = 0
|
||||||
for line in as_out.stdout.readlines():
|
for line in as_out.stdout.readlines():
|
||||||
length = length + len(line)
|
length = length + len(line)
|
||||||
for c in line:
|
for c in line:
|
||||||
print ord(c)
|
num+=1
|
||||||
print ", "
|
print("0x%0.2X, " % c, end="")
|
||||||
print " 0 };\n\n"
|
if num%16 == 0:
|
||||||
print "int builtins_bitcode_" + target + "_length = " + str(length) + ";\n"
|
print()
|
||||||
|
print(" 0 };\n\n")
|
||||||
|
print("int builtins_bitcode_" + target + "_length = " + str(length) + ";\n")
|
||||||
|
|
||||||
as_out.wait()
|
as_out.wait()
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,14 @@ import sys
|
|||||||
|
|
||||||
t=str(sys.argv[1])
|
t=str(sys.argv[1])
|
||||||
|
|
||||||
print "char stdlib_" + t + "_code[] = { "
|
print("char stdlib_" + t + "_code[] = { ")
|
||||||
|
|
||||||
|
num = 0
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
for c in line:
|
for c in line:
|
||||||
print ord(c)
|
num+=1
|
||||||
print ", "
|
print("0x%0.2X, " % ord(c), end="")
|
||||||
|
if num%16 == 0:
|
||||||
|
print()
|
||||||
|
|
||||||
print "0 };"
|
print("0 };")
|
||||||
|
|||||||
Reference in New Issue
Block a user