summaryrefslogtreecommitdiffstats
path: root/llvm/examples/Kaleidoscope/MCJIT/lazy
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@quarkslab.com>2019-01-03 14:11:33 +0000
committerSerge Guelton <sguelton@quarkslab.com>2019-01-03 14:11:33 +0000
commit4a27478a5b8bd9f13fef65e66b291a352c532371 (patch)
treea086542fe11fba6d8779ca2fa96036d80af04312 /llvm/examples/Kaleidoscope/MCJIT/lazy
parent41f98c834bc62a605ec51032482369cfa128d711 (diff)
downloadbcm5719-llvm-4a27478a5b8bd9f13fef65e66b291a352c532371.tar.gz
bcm5719-llvm-4a27478a5b8bd9f13fef65e66b291a352c532371.zip
Python compat - print statement
Make sure all print statements are compatible with Python 2 and Python3 using the `from __future__ import print_function` statement. Differential Revision: https://reviews.llvm.org/D56249 llvm-svn: 350307
Diffstat (limited to 'llvm/examples/Kaleidoscope/MCJIT/lazy')
-rw-r--r--llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py b/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py
index 96dd6db5da3..87bbfbf32bd 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py
+++ b/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+from __future__ import print_function
+
import sys
import random
@@ -173,7 +175,7 @@ class KScriptGenerator:
def generateKScript(filename, numFuncs, elementsPerFunc, funcsBetweenExec, callWeighting, timingScript):
""" Generate a random Kaleidoscope script based on the given parameters """
- print "Generating " + filename
+ print("Generating " + filename)
print(" %d functions, %d elements per function, %d functions between execution" %
(numFuncs, elementsPerFunc, funcsBetweenExec))
print(" Call weighting = %f" % callWeighting)
@@ -200,7 +202,7 @@ def generateKScript(filename, numFuncs, elementsPerFunc, funcsBetweenExec, callW
script.writeEmptyLine()
script.writeFinalFunctionCounts()
funcsCalled = len(script.calledFunctions)
- print " Called %d of %d functions, %d total" % (funcsCalled, numFuncs, script.totalCallsExecuted)
+ print(" Called %d of %d functions, %d total" % (funcsCalled, numFuncs, script.totalCallsExecuted))
timingScript.writeTimingCall(filename, numFuncs, funcsCalled, script.totalCallsExecuted)
# Execution begins here
@@ -216,4 +218,4 @@ dataSets = [(5000, 3, 50, 0.50), (5000, 10, 100, 0.10), (5000, 10, 5, 0.10), (5
for (numFuncs, elementsPerFunc, funcsBetweenExec, callWeighting) in dataSets:
filename = "test-%d-%d-%d-%d.k" % (numFuncs, elementsPerFunc, funcsBetweenExec, int(callWeighting * 100))
generateKScript(filename, numFuncs, elementsPerFunc, funcsBetweenExec, callWeighting, timingScript)
-print "All done!"
+print("All done!")
OpenPOWER on IntegriCloud