CStuff¶
-
public final class
CStuff
¶ C language specific methods.
Methods¶
buildAllocate¶
-
protected static Tree
buildAllocate
(Tree mallocTree, int typeSize, SymbolTable symbolTable, Instruction instruction)¶ Builds a transformed copy of the C-syntax mallocTree, using the IL syntax op_allocate
- Parameters
mallocTree – a call to malloc or calloc, possibly enclosed into a cast.
- Returns
an op_allocate tree, containing in particular the cast type if present.
buildMalloc¶
-
public static Tree
buildMalloc
(Tree allocateTree, Tree assigned)¶ Builds a transformed copy of the IL syntax op_allocate, as a C-syntax mallocTree. Decision of the C-style allocation (malloc, calloc, or cudaMalloc) is based the “sourcetree” annotation of the allocateTree.
- Parameters
allocateTree – an op_allocate tree a call to malloc or calloc, possibly enclosed into a cast.
assigned – the variable that receives the allocated memory. Used only when regenerating a cudaMalloc.
- Returns
a call to malloc or calloc, possibly enclosed into a cast, or a call to cudaMalloc
initCSymbolTable¶
-
public static void
initCSymbolTable
(SymbolTable symbolTable)¶ Inserts predefined C stuff into this initial symbolTable.
isAPow¶
-
protected static boolean
isAPow
(SymbolTable symbolTable, Tree callTree)¶