From 5dd0948c6505591f25531e3be88424ca5eef56c8 Mon Sep 17 00:00:00 2001 From: Ilan Schnell Date: Thu, 31 Jan 2013 17:54:20 -0600 Subject: [PATCH] cleanup --- docs/gh-pages.py | 2 +- llpython/nobitey.py | 2 +- llvm-config-win32.py | 4 ++-- llvm/passes.py | 4 ++-- llvm/tbaa.py | 8 ++++---- llvm/test_llvmpy.py | 4 ++-- setup.py | 2 +- test/loopvectorize.c | 2 +- test/loopvectorize.py | 2 +- test/test_debuginfo.py | 2 +- www/makeweb.py | 2 +- www/src/license.txt | 4 ++-- www/src/userguide.txt | 10 +++++----- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/gh-pages.py b/docs/gh-pages.py index d9c8614..dd30e28 100755 --- a/docs/gh-pages.py +++ b/docs/gh-pages.py @@ -86,7 +86,7 @@ if __name__ == '__main__': tag = sh2('git describe --exact-match') except CalledProcessError: tag = "dev" # Fallback - + startdir = os.getcwdu() if not os.path.exists(pages_dir): # init the repo diff --git a/llpython/nobitey.py b/llpython/nobitey.py index b756fc8..014216b 100644 --- a/llpython/nobitey.py +++ b/llpython/nobitey.py @@ -16,7 +16,7 @@ from pyaddfunc import pyaddfunc LLVM_TO_INT_PARSE_STR_MAP = { 8 : 'b', - 16 : 'h', + 16 : 'h', 32 : 'i', # Note that on 32-bit systems sizeof(int) == sizeof(long) 64 : 'L', # Seeing sizeof(long long) == 8 on both 32 and 64-bit platforms } diff --git a/llvm-config-win32.py b/llvm-config-win32.py index 2b6e8f5..595452c 100644 --- a/llvm-config-win32.py +++ b/llvm-config-win32.py @@ -63,7 +63,7 @@ Shell32 print('-lLLVMNVPTXCodeGen') print('-lLLVMNVPTXDesc') print('-lLLVMNVPTXInfo') -elif sys.argv[1] == '--includedir': +elif sys.argv[1] == '--includedir': llvmbin = find_path_of('llvm-tblgen.exe') if llvmbin is None: raise RuntimeError('Could not find LLVM') @@ -71,7 +71,7 @@ elif sys.argv[1] == '--includedir': if not os.path.exists(os.path.join(incdir, 'llvm/BasicBlock.h')): raise RuntimeError('Could not find LLVM include dir') print incdir -elif sys.argv[1] == '--libdir': +elif sys.argv[1] == '--libdir': llvmbin = find_path_of('llvm-tblgen.exe') if llvmbin is None: raise RuntimeError('Could not find LLVM') diff --git a/llvm/passes.py b/llvm/passes.py index b1f236c..4d7efb4 100644 --- a/llvm/passes.py +++ b/llvm/passes.py @@ -156,7 +156,7 @@ class PassManager(object): def add(self, pass_obj): '''Add a pass to the pass manager. - + pass_obj --- Either a Pass instance, a string name of a pass ''' if isinstance(pass_obj, Pass): @@ -340,7 +340,7 @@ def build_pass_managers(tm, opt=2, loop_vectorize=False, vectorize=False, inline_threshold=2000, pm=True, fpm=True, mod=None): ''' tm --- The TargetMachine for which the passes are optimizing for. - The TargetMachine must stay alive until the pass managers + The TargetMachine must stay alive until the pass managers are removed. opt --- [0-3] Optimization level. Default to 2. loop_vectorize --- [boolean] Whether to use loop-vectorizer. diff --git a/llvm/tbaa.py b/llvm/tbaa.py index d8e0074..b510ce2 100644 --- a/llvm/tbaa.py +++ b/llvm/tbaa.py @@ -2,11 +2,11 @@ from llvm.core import * class TBAABuilder(object): '''Simplify creation of TBAA metadata. - - Each TBAABuidler object operates on a module. + + Each TBAABuidler object operates on a module. User can create multiple TBAABuilder on a module ''' - + def __init__(self, module, rootid): ''' module --- the module to use. @@ -23,7 +23,7 @@ class TBAABuilder(object): def get_node(self, name, parent=None, const=False): '''Returns a MetaData object representing a TBAA node. - Use loadstore_instruction.set_metadata('tbaa', node) to + Use loadstore_instruction.set_metadata('tbaa', node) to bind a type to a memory. ''' parent = parent or self.root diff --git a/llvm/test_llvmpy.py b/llvm/test_llvmpy.py index a5fe957..05b7d72 100644 --- a/llvm/test_llvmpy.py +++ b/llvm/test_llvmpy.py @@ -454,7 +454,7 @@ class TestEngineBuilder(TestCase): with self.assertRaises(llvm.LLVMException): # Ensure the targetmachine is owned. llvm._util.check_is_unowned(tm) - + with self.assertRaises(llvm.LLVMException): # Ensure the module is owned. @@ -932,7 +932,7 @@ class TestCPUSupport(TestCase): arg = le.GenericValue.real(Type.double(), 1.234) retval = ee.run_function(func, [arg]) - + golden = math.sin(1.234) answer = retval.as_real(Type.double()) self.assertTrue(abs(answer-golden)/golden < 1e-5) diff --git a/setup.py b/setup.py index 839d816..afbf56e 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ def run_llvm_config(args): if run_llvm_config(['--version']) == '': sys.exit("Cannot invoke llvm-config.\n" - "Try setting LLVM_CONFIG_PATH=/path/to/llvm-config") + "Try setting LLVM_CONFIG_PATH=/path/to/llvm-config") def get_libs_and_objs(components): parts = run_llvm_config(['--libs'] + components).split() diff --git a/test/loopvectorize.c b/test/loopvectorize.c index a46b633..a498898 100644 --- a/test/loopvectorize.c +++ b/test/loopvectorize.c @@ -41,4 +41,4 @@ void ex7(int *A, int *B, int n, int k) { void ex8(int *A, char *B, int n, int k) { for (int i = 0; i < n; ++i) A[i] += 4 * B[i]; -} \ No newline at end of file +} diff --git a/test/loopvectorize.py b/test/loopvectorize.py index 9cf1654..2c12d5b 100644 --- a/test/loopvectorize.py +++ b/test/loopvectorize.py @@ -40,4 +40,4 @@ class TestLoopVectorizer(TestCase): if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/test/test_debuginfo.py b/test/test_debuginfo.py index 0340c1b..33dbbdb 100644 --- a/test/test_debuginfo.py +++ b/test/test_debuginfo.py @@ -130,4 +130,4 @@ if __name__ == '__main__': # TestDebugInfo("test_debug_info_compile_unit").debug() # tester = TestDebugInfo("test_debug_info_compile_unit") # debug_in_gdb(tester.test_debug_info_compile_unit()) - unittest.main() \ No newline at end of file + unittest.main() diff --git a/www/makeweb.py b/www/makeweb.py index 936b69e..81c9283 100755 --- a/www/makeweb.py +++ b/www/makeweb.py @@ -139,7 +139,7 @@ def get_opts(): usage = "usage: %prog [options] srcdir destdir" p = OptionParser(usage=usage) - p.add_option("-f", "--force", action="store_true", dest="force", default=False, + p.add_option("-f", "--force", action="store_true", dest="force", default=False, help="ignore timestamps and force build of all files") p.add_option("-v", "--verbose", action="count", dest="verbose", default=0, help="be chatty (use more v's to be more friendly)") diff --git a/www/src/license.txt b/www/src/license.txt index e40da20..9465a49 100644 --- a/www/src/license.txt +++ b/www/src/license.txt @@ -1,12 +1,12 @@ License ======= -llvm-py is distributed under the +llvm-py is distributed under the http://www.opensource.org/licenses/bsd-license.php[new BSD license]. This is similar to LLVM's license. You should be able to use llvm-py where-ever and how-ever you're able to use LLVM itself. -The license text is present in the +The license text is present in the http://code.google.com/p/llvm-py/source/browse/trunk/LICENSE[LICENSE] file in the distribution, and is reproduced here: diff --git a/www/src/userguide.txt b/www/src/userguide.txt index cf67e1c..bbd7ad3 100644 --- a/www/src/userguide.txt +++ b/www/src/userguide.txt @@ -35,7 +35,7 @@ information is available link:license.html[here]. .Platforms llvm-py has been built/tested/reported to work on various GNU/Linux flavours, *BSD, Mac OS X; on i386 and amd64 architectures. Windows is not -supported, for a variety of reasons. +supported, for a variety of reasons. .Versions llvm-py 0.6 requires verion 2.7 of LLVM. It will not work with previous @@ -433,7 +433,7 @@ Here is a quick overview of the contents of each package: sizes and alignment of primitive types, endinanness etc) .llvm.passes -- PassManager -- represents an LLVM pass manager +- PassManager -- represents an LLVM pass manager - FunctionPassManager -- represents an LLVM function pass manager - constants +PASS_*+ that represent various passes @@ -1007,7 +1007,7 @@ The `Function` object represents an instance of a function type. Such objects contain `Argument` objects, which represent the actual, local-variable-like arguments of the function (not to be confused with the arguments returned by a function _type_ object -- these represent -the _type_ of the arguments). +the _type_ of the arguments). The various `Instruction`-s are created by the `Builder` class. Most instructions are represented by `Instruction` itself, but there are @@ -1260,7 +1260,7 @@ Global Value (llvm.core) The class `llvm.core.GlobalValue` represents module-scope aliases, variables and functions. Global variables are represented by the sub-class -`llvm.core.GlobalVariable` and functions by `llvm.core.Function`. +`llvm.core.GlobalVariable` and functions by `llvm.core.Function`. Global values have the read-write properties `linkage`, `section`, `visibility` and `alignment`. Use one of the following constants (from @@ -1841,7 +1841,7 @@ The `llvm.core.PHINode` is a subclass of created (using `Builder.phi`) the phi node contains no incoming blocks (nor their corresponding values). To add an incoming arc to the phi node, use the `add_incoming` method, which takes a source -block (`llvm.core.BasicBlock` object) and a value (object of +block (`llvm.core.BasicBlock` object) and a value (object of `llvm.core.Value` or of a class derived from it) that the phi node will take on if control branches in from that block.