Generate an object call for a python function given during compilation time
Returns whether the given node is a Name
Set a type and simple typed variable on a node
Bases: numba.nodes.basenodes.ExprNode
Clone a CloneableNode. This allows the node’s sub-expressions to be re-used without re-evaluating them.
The CloneableNode must be evaluated before the CloneNode is evaluated!
Bases: numba.nodes.basenodes.ExprNode
Create a node that can be cloned. This allows sub-expressions to be re-used without re-evaluating them.
Bases: numba.nodes.basenodes.Node
Node that is an expression.
Bases: numba.nodes.basenodes.ExprNode
Node that allows an expression to execute a bunch of statements first.
Bases: numba.nodes.basenodes.Node
This code is a wrapper function callable from Python using NumbaFunction (see numba/numbafunction.c):
It unpacks the tuple to native types, calls the wrapped function, and coerces the return type back to an object.
Bases: _ast.Name, numba.nodes.basenodes.ExprNode
Bases: _ast.AST
Superclass for Numba AST nodes
Bases: numba.nodes.basenodes.WithPythonNode
with nopython: ...
Bases: numba.nodes.basenodes.Node
with python: ...
Bases: numba.nodes.basenodes.ExprNode
mycomplex.conjugate()
Bases: numba.nodes.callnodes.NativeCallNode
Inject a low-level macro in the function at the call site.
Low-level macros are Python functions that take a FunctionCache instance, a LLVM builder instance, and a set of arguments, construct LLVM code, and return some kind of LLVM value result. The passed signature should reflect the Numba types of the expected input parameters, and the type of the resulting value (this does not restrict polymorphism at the LLVM type level in the macro expansion function).
Bases: numba.nodes.basenodes.ExprNode
For calling an external llvm function where you only have the signature and the function name.
Bases: numba.nodes.callnodes.NativeCallNode
Call an llvm intrinsic function
Bases: numba.nodes.callnodes.NativeCallNode
Low level call a libc math function
Bases: numba.nodes.callnodes.FunctionCallNode
Bases: numba.nodes.callnodes.NativeCallNode
Call a function which is given as a node
Bases: numba.nodes.callnodes.NativeCallNode
Call a ctypes function
Bases: numba.nodes.basenodes.Node
Node that has control flow basic blocks.
Bases: _ast.For, numba.nodes.cfnodes.FlowNode
A for loop node. Has the basic block attributes from FlowNode
Bases: _ast.If, numba.nodes.cfnodes.FlowNode
An if statement node. Has the basic block attributes from FlowNode
Bases: numba.nodes.basenodes.Node
Evaluate a statement or expression in a new LLVM basic block.
Bases: numba.nodes.basenodes.Node
Wraps an ast.Name() to indicate that the result may be unused.
Bases: _ast.While, numba.nodes.cfnodes.FlowNode
A while loop node. Has the basic block attributes from FlowNode
Remove all control flow basic blocks from the CFG given a FlowNode and the CFG. Also removes Name references from cf_references.
Implements ‘lhs if cond_left <op> cond_right else rhs’
Merge CFG blocks into the AST. E.g.
While(test=x, body=y)
becomes
While(test=ControlBlock(0, body=[x]), body=ControlBlock(1, body=[y]))
Bases: numba.nodes.callnodes.NativeCallNode
Call to closure or inner function.
Bases: numba.nodes.basenodes.ExprNode
Inner functions or closures.
When coerced to an object, a wrapper PyMethodDef gets created, and at call time a function is dynamically created with the closure scope.
- func_def:
- AST FunctionDef of the function
- closure_type:
- numba.typesystem.ClosureType
- outer_py_func:
- Outer Python function (or None!)
Bases: numba.nodes.basenodes.ExprNode
Load the closure scope for the function or NULL
Bases: numba.nodes.basenodes.ExprNode
Explicit cast by user, e.g. double(value)
Bases: numba.nodes.coercionnodes.CoercionNode
Coerce objects to native values
Bases: numba.nodes.coercionnodes.CoercionNode
Coerce native values to objects
Bases: numba.nodes.basenodes.ExprNode
Coerce a node to a different type
Numpy array attributes, such as ‘data’, get rewritten to direct accesses. Since they are being coerced back to objects, use a generic attribute access instead.
dst_type is always the same as type, and ‘type’ is kept consistent with Variable.type
Bases: numba.nodes.basenodes.ExprNode
Coerce to the type of the given variable. The type of the variable may change in the meantime (e.g. may be promoted or demoted).
Bases: numba.nodes.basenodes.ExprNode
Coerces a variable of some type to another type for a phi node in a successor block.
Bases: numba.nodes.basenodes.ExprNode
Coerce a node to the destination type. The node need not yet have a type or variable.
Bases: numba.nodes.basenodes.ExprNode
Wrap a constant.
Bases: numba.nodes.basenodes.ExprNode
Check for an exception.
badval: if this value is returned, propagate an error goodval: if this value is not returned, propagate an error
If exc_type, exc_msg and optionally exc_args are given, an error is raised instead of propagating it.
See RaiseNode for the exc_* arguments.
Bases: numba.nodes.basenodes.ExprNode
Propagate an exception (jump to the error label). This is resolved at code generation time and can be generated at any moment.
Bases: numba.nodes.basenodes.ExprNode
Check for a set Python exception using PyErr_Occurred().
Can be set any time after type inference. This node is resolved during late specialization.
Bases: numba.nodes.basenodes.ExprNode
Raise an exception.
exception_type: The Python exception type
- exc_type: The Python exception as an AST node
- May be passed in as a Python exception type
- exc_msg: The message to print as an AST node
- May be passed in as a string
- exc_args: If given, must be an list of AST nodes representing the
- arguments to PyErr_Format (matching the format specifiers at runtime in exc_msg)
Bases: numba.nodes.extnodes.ExtensionMethod
Bases: numba.nodes.basenodes.ExprNode
Create an extension type attribute node if the attribute is known to exist (and isn’t being inferred)
Bases: numba.nodes.basenodes.ExprNode
Bases: numba.nodes.basenodes.ExprNode
Instantiate an extension type. Currently unused.
alias of UserNode
Bases: numba.nodes.basenodes.ExprNode
Wrap an LLVM value.
Allow annotating AST nodes with some metadata, and querying for that metadata.
Bases: numba.nodes.basenodes.ExprNode
Bases: numba.nodes.basenodes.ExprNode
Allocate a new array with data.
Bases: numba.nodes.basenodes.ExprNode
Allocate a new array given the attributes.
Bases: numba.nodes.basenodes.ExprNode
Returns a tuple of (dptr, strides) - dptr: a pointer of the data buffer - strides: a pointer to an array of stride information;
has ndim elements.
Low-level specialized equivalent of ArrayNewNode
Load the shape values from an ndarray
Load the stride values from an ndarray
Build phi values for preloaded data/shape/stride values.
Make phi values for the extents of an array variable merge
Make phi values for the strides of an array variable merge
Bases: numba.nodes.basenodes.ExprNode
Return None.
Bases: numba.nodes.basenodes.ExprNode
Refer to a Python object in the llvm code.
Bases: numba.nodes.basenodes.ExprNode
Coerce a node to a temporary which is reference counted.
Bases: numba.nodes.basenodes.ExprNode
Reference an ObjectTempNode, without evaluating its subexpressions. The ObjectTempNode must already have been evaluated.
Bases: numba.nodes.basenodes.ExprNode
Dereference a pointer
Bases: numba.nodes.basenodes.ExprNode
Bitcast objects to void *
Struct and complex nodes.
Structs are allocated on the stack, and not mutated as values. This is because mutations are attribute or index assignments, which are not recognized as variable assignments. Hence mutation cannot propagate new values. So we mutate what we have on the stack.
Bases: numba.nodes.basenodes.ExprNode
Bases: numba.nodes.basenodes.ExprNode
Bases: numba.nodes.basenodes.ExprNode
Tells the type inferencer that the node is actually a valid struct that we can mutate. For instance
func().a = 2
is wrong if func() returns a struct by value. So we only allow references like struct.a = 2 and array[i].a = 2.
Bases: numba.nodes.basenodes.ExprNode
Create a temporary to store values in. Does not perform reference counting.
TBAA metadata node unique to this temporary. This is valid since one cannot take the address of a temporary.
Bases: numba.nodes.basenodes.ExprNode
Node that users can subclass and insert in the AST without using mixins to provide user-specified functionality.
Generate code for this node.
Must return an LLVM Value.
Infer the type of this node and set it self.type.
The return value will replace this node in the AST.
Just before code generation. Useful to rewrite this node in terms of other existing fundamental operations.
Implementing this method is optional.
Bases: type