GPUOcelot
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

ir::LLVMInstruction Class Reference

A class used to represent any LLVM Instruction. More...

#include <LLVMInstruction.h>

Inheritance diagram for ir::LLVMInstruction:
Inheritance graph
[legend]
Collaboration diagram for ir::LLVMInstruction:
Collaboration graph
[legend]

List of all members.

Classes

class  Operand
 A class for a basic LLVM Operand. More...
class  Parameter
 A parameter operand. More...
class  Type
 A class for an LLVM basic or derived type. More...
union  Value
 The value of the operand if it is a constant. More...

Public Types

enum  Opcode {
  Add, Alloca, And, Ashr,
  Bitcast, Br, Call, Extractelement,
  Extractvalue, Fadd, Fcmp, Fdiv,
  Fmul, Fpext, Fptosi, Fptoui,
  Fptrunc, Free, Frem, Fsub,
  Getelementptr, Icmp, Insertelement, Insertvalue,
  Inttoptr, Invoke, Load, Lshr,
  Malloc, Mul, Or, Phi,
  Ptrtoint, Ret, Sdiv, Select,
  Sext, Shl, Shufflevector, Sitofp,
  Srem, Store, Sub, Switch,
  Trunc, Udiv, Uitofp, Unreachable,
  Unwind, Urem, VaArg, Xor,
  Zext, InvalidOpcode
}
 

The opcode of the instruction.

More...
enum  DataType {
  I1, I8, I16, I32,
  I64, I128, F32, F64,
  F128, InvalidDataType
}
 

Supported LLVM Types.

More...
enum  Comparison {
  False, Oeq, Ogt, Oge,
  Olt, Ole, One, Ord,
  Ueq, Ugt, Uge, Ult,
  Ule, Une, Uno, True,
  Eq, Ne, Sgt, Sge,
  Slt, Sle
}
 

Floating Point Comparison.

More...
enum  CallingConvention {
  CCallingConvention, FastCallingConvention, ColdCallingConvention, DefaultCallingConvention,
  InvalidCallingConvention
}
 

Valid calling conventions.

More...
enum  ParameterAttribute {
  ZeroExtend, SignExtend, InRegister, ByValue,
  StructureReturn, NoAlias, NoCapture, Nested,
  InvalidParameterAttribute
}
 

Valid Parameter Attributes.

More...
enum  FunctionAttribute {
  AlwaysInline = 1, NoInline = 2, OptimizeSize = 4, NoReturn = 8,
  NoUnwind = 16, ReadNone = 32, ReadOnly = 64, StackSmashingProtector = 128,
  StackSmashingProtectorRequired = 256, NoRedZone = 512, NoImplicitFloat = 1024, Naked = 2048
}
 

Valid Function Attributes.

More...
typedef std::vector< OperandOperandVector
 A vector of operands.
typedef std::vector< ParameterParameterVector
 A vector of Parameters.

Public Member Functions

 LLVMInstruction (Opcode op=InvalidOpcode)
 Default constructor.
 LLVMInstruction (const LLVMInstruction &i)
 Copy constructor to prevent reassignment of opcode.
const LLVMInstructionoperator= (const LLVMInstruction &i)
 Assignment operator to prevent modification of opcode.
virtual Instructionclone (bool copy=true) const =0
 Return a pointer to a new Instruction.
virtual std::string toString () const =0
 Returns a string representation of the instruction.
virtual std::string valid () const =0
 Determines if the instruction is valid, returns an empty string if valid otherwise an error message.

Static Public Member Functions

static std::string toString (Opcode o)
 Convert an opcode to a string parsable by LLVM.
static std::string toString (DataType d)
 Convert a datatype to a string parsable by LLVM.
static std::string toString (CallingConvention cc)
 Convert a calling convention to a string.
static std::string toString (ParameterAttribute attribute)
 Convert a Parameter attribute to a string.
static std::string toString (Comparison comp)
 Convert a Comparison to a string.
static std::string functionAttributesToString (int attributes)
 Convert a series of function attributes to a string.
static bool isInt (DataType d)
 Determine if a datatype is an int.
static DataType getIntOfSize (unsigned int bits)
 Get an int with the specified number of bits.
static unsigned int bits (DataType type)
 Get the number of bits in a DataType.

Public Attributes

const Opcode opcode
 The opcode of the instruction.

Detailed Description

A class used to represent any LLVM Instruction.


Member Typedef Documentation

A vector of operands.

A vector of Parameters.


Member Enumeration Documentation

Valid calling conventions.

Enumerator:
CCallingConvention 
FastCallingConvention 
ColdCallingConvention 
DefaultCallingConvention 
InvalidCallingConvention 

Floating Point Comparison.

Enumerator:
False 
Oeq 
Ogt 
Oge 
Olt 
Ole 
One 
Ord 
Ueq 
Ugt 
Uge 
Ult 
Ule 
Une 
Uno 
True 
Eq 
Ne 
Sgt 
Sge 
Slt 
Sle 

Supported LLVM Types.

Enumerator:
I1 
I8 
I16 
I32 
I64 
I128 
F32 
F64 
F128 
InvalidDataType 

Valid Function Attributes.

Enumerator:
AlwaysInline 
NoInline 
OptimizeSize 
NoReturn 
NoUnwind 
ReadNone 
ReadOnly 
StackSmashingProtector 
StackSmashingProtectorRequired 
NoRedZone 
NoImplicitFloat 
Naked 

The opcode of the instruction.

Enumerator:
Add 
Alloca 
And 
Ashr 
Bitcast 
Br 
Call 
Extractelement 
Extractvalue 
Fadd 
Fcmp 
Fdiv 
Fmul 
Fpext 
Fptosi 
Fptoui 
Fptrunc 
Free 
Frem 
Fsub 
Getelementptr 
Icmp 
Insertelement 
Insertvalue 
Inttoptr 
Invoke 
Load 
Lshr 
Malloc 
Mul 
Or 
Phi 
Ptrtoint 
Ret 
Sdiv 
Select 
Sext 
Shl 
Shufflevector 
Sitofp 
Srem 
Store 
Sub 
Switch 
Trunc 
Udiv 
Uitofp 
Unreachable 
Unwind 
Urem 
VaArg 
Xor 
Zext 
InvalidOpcode 

Valid Parameter Attributes.

Enumerator:
ZeroExtend 
SignExtend 
InRegister 
ByValue 
StructureReturn 
NoAlias 
NoCapture 
Nested 
InvalidParameterAttribute 

Constructor & Destructor Documentation

ir::LLVMInstruction::LLVMInstruction ( Opcode  op = InvalidOpcode)

Default constructor.

ir::LLVMInstruction::LLVMInstruction ( const LLVMInstruction i)

Copy constructor to prevent reassignment of opcode.


Member Function Documentation

unsigned int ir::LLVMInstruction::bits ( DataType  type) [static]

Get the number of bits in a DataType.

virtual Instruction* ir::LLVMInstruction::clone ( bool  copy = true) const [pure virtual]
std::string ir::LLVMInstruction::functionAttributesToString ( int  attributes) [static]

Convert a series of function attributes to a string.

LLVMInstruction::DataType ir::LLVMInstruction::getIntOfSize ( unsigned int  bits) [static]

Get an int with the specified number of bits.

bool ir::LLVMInstruction::isInt ( DataType  d) [static]

Determine if a datatype is an int.

const LLVMInstruction & ir::LLVMInstruction::operator= ( const LLVMInstruction i)

Assignment operator to prevent modification of opcode.

std::string ir::LLVMInstruction::toString ( ParameterAttribute  attribute) [static]

Convert a Parameter attribute to a string.

std::string ir::LLVMInstruction::toString ( Opcode  o) [static]

Convert an opcode to a string parsable by LLVM.

std::string ir::LLVMInstruction::toString ( DataType  d) [static]

Convert a datatype to a string parsable by LLVM.

std::string ir::LLVMInstruction::toString ( Comparison  comp) [static]

Convert a Comparison to a string.

virtual std::string ir::LLVMInstruction::toString ( ) const [pure virtual]
std::string ir::LLVMInstruction::toString ( CallingConvention  cc) [static]

Convert a calling convention to a string.

virtual std::string ir::LLVMInstruction::valid ( ) const [pure virtual]

Member Data Documentation

The opcode of the instruction.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines