Gimple statements

TODO

class gcc.Gimple

A statement, in GCC’s Gimple representation.

The __str__ method is implemented using GCC’s own pretty-printer for gimple, so e.g.:

str(stmt)

might return:

'D.3259 = (long unsigned int) i;'
loc

Source code location of this statement, as a gcc.Location (or None)

block

The lexical block holding this statement, as a gcc.Tree

exprtype

The type of the main expression computed by this statement, as a gcc.Tree (which might be gcc.VoidType)

class gcc.GimpleAssign

Subclass of gcc.Gimple: an assignment of an expression to an l-value

lhs

Left-hand-side of the assignment, as a gcc.Tree

rhs

The operands on the right-hand-side of the expression, as a list of gcc.Tree instances

exprcode

The kind of the expression, as an gcc.Tree subclass (the type itself, not an instance)

class gcc.GimpleCall

Subclass of gcc.Gimple: an invocation of a function, assigning the result to an l-value

lhs

Left-hand-side of the assignment, as a gcc.Tree

rhs

The operands on the right-hand-side of the expression, as a list of gcc.Tree instances

fn

The function being called, as a gcc.Tree

fndecl

The declaration of the function being called (if any), as a gcc.Tree

args

The arguments for the call, as a list of gcc.Tree

class gcc.GimpleReturn

Subclass of gcc.Gimple: a “return” statement, signifying the end of a gcc.BasicBlock

retval

The return value, as a gcc.Tree

class gcc.GimpleCond

Subclass of gcc.Gimple: an “if” statement, signifying the end of a gcc.BasicBlock

lhs

Left-hand-side of the assignment, as a gcc.Tree

rhs

The operands on the right-hand-side of the expression, as a list of gcc.Tree instances

exprcode

The kind of the expression, as an gcc.Tree subclass (the type itself, not an instance)

class gcc.GimplePhi

Subclass of gcc.Gimple used in the SSA passes: a “PHI” or “phoney” function, for merging the various possible values a variable can have based on the edge that we entered this gcc.BasicBlock on.

lhs

Left-hand-side of the assignment, as a gcc.Tree (generally a gcc.SsaName, I believe)

args

A list of (gcc.Tree, gcc.Edge) pairs representing the possible (expr, edge) inputs

Previous topic

gcc.Tree and its subclasses

Next topic

Usage example: a static analysis tool for CPython extension code

This Page