LLVM::Builder - LLVM builder class
version 0.10
A LLVM::Builder is the means of building instructions and represents a point within a basic block.
LLVM::Builder
Create a new LLVM::Builder object.
Postion the LLVM::Builder at the end of the given LLVM::BasicBlock.
See the LLVM reference for more information about the single instructions.
Append a ret instruction to the block. This function takes a LLVM::Value representing the value to be returned and returns a LLVM::Value.
Append a void ret instruction to the block. This function returns a LLVM::Value.
Append a branch instruction to the block. This function takes a LLVM::BasicBlock $dest.
$dest
Append a conditional instruction to the block. This function takes a LLVM::Value $if representing the condition (e.g. it can be the value returned by a icmp or fcmp instruction) and two LLVM::BasicBlock: the first executed if the condition is true, the second executed otherwise.
$if
Append an unreachable instruction to the block.
The binary operations require two arguments of the same LLVM::Type and produce a single LLVM::Value.
Append an integer add instruction to the block and name the result $name.
$name
Append a floating add instruction to the block and name the result $name.
Append a mul instruction to the block and name the result $name.
Append a floating mul instruction to the block and name the result $name.
Append a sub instruction to the block and name the result $name.
Append a floating sub instruction to the block and name the result $name.
Append an unsigned div instruction to the block and name the result $name.
Append a signed div instruction to the block and name the result $name.
Append a floating div instruction to the block and name the result $name.
The binary bitwise operations require two arguments of the same LLVM::Type and produce a single LLVM::Value.
Append a shift left instruction to the block and name the result $name.
Append a logical shift right instruction to the block and name the result $name.
Append an arithmetic shift right instruction to the block and name the result $name.
Append an and instruction to the block and name the result $name.
Append an or instruction to the block and name the result $name.
Append a xor instruction to the block and name the result $name.
Append a trunc instruction which takes a LLVM::Value and the conversion output LLVM::Type, and name the result $name.
Append an integer cmp instruction to the block and name the result $name. The predicate $pred must be one of:
$pred
"eq"
equal
"ne"
not equal
"ugt"
unsigned greater than
"uge"
unsigned greater or equal
"ult"
unsigned less than
"ule"
unsigned less or equal
"sgt"
signed greater than
"sge"
signed greater or equal
"slt"
signed less than
"sle"
signed less or equal
Append a float cmp instruction to the block and name the result $name. The predicate $pred must be one of:
"false"
no comparison, always returns false
"oeq"
ordered and equal
"ogt"
ordered and greater than
"oge"
ordered and greater than or equal
"olt"
ordered and less than
"ole"
ordered and less than or equal
"one"
ordered and not equal
"ord"
ordered (no nans)
"ueq"
unordered or equal
unordered or greater than
unordered or greater than or equal
unordered or less than
unordered or less than or equal
"une"
unordered or not equal
"uno"
unordered (either nans)
"true"
no comparison, always returns true
Append a call instruction to the block and name the result $name. The generated instruction will call the LLVM::Value representing a function $func with the given arguments of type LLVM::Value.
$func
Append a select instruction to the block and name the result $name. $if, $then and $else are LLVM::Values.
$then
$else
Alessandro Ghedini <alexbio@cpan.org>
Copyright 2012 Alessandro Ghedini.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install LLVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LLVM
CPAN shell
perl -MCPAN -e shell install LLVM
For more information on module installation, please visit the detailed CPAN module installation guide.