cleanup
This commit is contained in:
parent
1d4c431b23
commit
5dd0948c65
13 changed files with 24 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
2
setup.py
2
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()
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,4 +40,4 @@ class TestLoopVectorizer(TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -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)")
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue