LLVM API Documentation
#include <Constants.h>
Inheritance diagram for llvm::ConstantExpr:
Public Member Functions | |
virtual bool | isNullValue () const |
unsigned | getOpcode () const |
getOpcode - Return the opcode at the root of this constant expression | |
const char * | getOpcodeName () const |
getOpcodeName - Return a string representation for an opcode. | |
virtual void | destroyConstant () |
virtual void | replaceUsesOfWithOnConstant (Value *From, Value *To, bool DisableChecking=false) |
Constant * | getOperand (unsigned i) |
Override methods to provide more type information... | |
Constant * | getOperand (unsigned i) const |
Static Public Member Functions | |
static Constant * | getCast (Constant *C, const Type *Ty) |
static Constant * | getSignExtend (Constant *C, const Type *Ty) |
static Constant * | getZeroExtend (Constant *C, const Type *Ty) |
static Constant * | getSelect (Constant *C, Constant *V1, Constant *V2) |
static Constant * | getSizeOf (const Type *Ty) |
static Constant * | get (unsigned Opcode, Constant *C1, Constant *C2) |
static Constant * | getNeg (Constant *C) |
static Constant * | getNot (Constant *C) |
static Constant * | getAdd (Constant *C1, Constant *C2) |
static Constant * | getSub (Constant *C1, Constant *C2) |
static Constant * | getMul (Constant *C1, Constant *C2) |
static Constant * | getDiv (Constant *C1, Constant *C2) |
static Constant * | getRem (Constant *C1, Constant *C2) |
static Constant * | getAnd (Constant *C1, Constant *C2) |
static Constant * | getOr (Constant *C1, Constant *C2) |
static Constant * | getXor (Constant *C1, Constant *C2) |
static Constant * | getSetEQ (Constant *C1, Constant *C2) |
static Constant * | getSetNE (Constant *C1, Constant *C2) |
static Constant * | getSetLT (Constant *C1, Constant *C2) |
static Constant * | getSetGT (Constant *C1, Constant *C2) |
static Constant * | getSetLE (Constant *C1, Constant *C2) |
static Constant * | getSetGE (Constant *C1, Constant *C2) |
static Constant * | getShl (Constant *C1, Constant *C2) |
static Constant * | getShr (Constant *C1, Constant *C2) |
static Constant * | getUShr (Constant *C1, Constant *C2) |
static Constant * | getSShr (Constant *C1, Constant *C2) |
static Constant * | getGetElementPtr (Constant *C, const std::vector< Constant * > &IdxList) |
static Constant * | getGetElementPtr (Constant *C, const std::vector< Value * > &IdxList) |
static bool | classof (const ConstantExpr *) |
Methods for support type inquiry through isa, cast, and dyn_cast:. | |
static bool | classof (const Value *V) |
Protected Member Functions | |
ConstantExpr (unsigned Opcode, Constant *C, const Type *Ty) | |
ConstantExpr (unsigned Opcode, Constant *C1, Constant *C2) | |
ConstantExpr (Constant *C, Constant *V1, Constant *V2) | |
ConstantExpr (Constant *C, const std::vector< Constant * > &IdxList, const Type *DestTy) | |
Static Protected Member Functions | |
static Constant * | getTy (const Type *Ty, unsigned Opcode, Constant *C1, Constant *C2) |
static Constant * | getShiftTy (const Type *Ty, unsigned Opcode, Constant *C1, Constant *C2) |
getShiftTy - Return a shift left or shift right constant expr | |
static Constant * | getSelectTy (const Type *Ty, Constant *C1, Constant *C2, Constant *C3) |
static Constant * | getGetElementPtrTy (const Type *Ty, Constant *C, const std::vector< Value * > &IdxList) |
Friends | |
struct | ConstantCreator< ConstantExpr, Type,std::pair< unsigned, std::vector< Constant * > > > |
struct | ConvertConstantType< ConstantExpr, Type > |
Definition at line 514 of file Constants.h.
|
Definition at line 287 of file Constants.cpp. References llvm::User::Operands. |
|
Definition at line 309 of file Constants.cpp. References llvm::User::Operands. |
|
Definition at line 294 of file Constants.cpp. References llvm::User::Operands. |
|
Definition at line 317 of file Constants.cpp. References E, and llvm::User::Operands. |
|
Reimplemented from llvm::Constant. Definition at line 629 of file Constants.h. References llvm::Value::ConstantExprVal, and llvm::Value::getValueType(). |
|
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 628 of file Constants.h. |
|
destroyConstant - Called if some element of this constant is no longer valid. At this point only other constants may be on the use_list for this constant. Any constants on our Use list must also be destroy'd. The implementation must be sure to remove the constant from the list of available cached constants. Implementations should call destroyConstantImpl as the last thing they do, to destroy all users and delete this. Reimplemented from llvm::Constant. Definition at line 1405 of file Constants.cpp. References llvm::Constant::destroyConstantImpl(). Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and replaceUsesOfWithOnConstant(). |
|
ConstantExpr::get - Return a binary or shift operator constant expression, folding if possible. Definition at line 1287 of file Constants.cpp. References Add(), llvm::ISD::And, llvm::Type::BoolTy, getTy(), llvm::Value::getType(), llvm::Type::isFloatingPoint(), llvm::Type::isInteger(), llvm::Type::isIntegral(), llvm::Instruction::isRelational(), Mul(), llvm::ISD::Or, llvm::ISD::SetEQ, llvm::ISD::SetGE, llvm::ISD::SetGT, llvm::ISD::SetLE, llvm::ISD::SetLT, llvm::ISD::SetNE, llvm::Instruction::Shl, llvm::Type::UByteTy, and llvm::ISD::Xor. Referenced by Add(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldInstruction(), getAdd(), getAnd(), getDiv(), getMul(), getNeg(), getNot(), getOr(), getRem(), getSetEQ(), getSetGE(), getSetGT(), getSetLE(), getSetLT(), getSetNE(), getShl(), getShr(), getSub(), getXor(), llvm::MapValue(), Mul(), negate(), llvm::BytecodeReader::ParseConstantValue(), RemapOperand(), and replaceUsesOfWithOnConstant(). |
|
Definition at line 340 of file Constants.cpp. Referenced by llvm::SCEVAddExpr::get(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), and Next(). |
|
Definition at line 355 of file Constants.cpp. References llvm::ISD::And, and get(). |
|
|
Definition at line 349 of file Constants.cpp. References get(). Referenced by llvm::SCEVUDivExpr::get(), and llvm::SCEVAddRecExpr::getNumIterationsInRange(). |
|
|
|
Getelementptr form. std::vector<Value*> is only accepted for convenience: all elements must be Constant's. Definition at line 1382 of file Constants.cpp. References llvm::PointerType::get(), getGetElementPtrTy(), llvm::GetElementPtrInst::getIndexedType(), and llvm::Value::getType(). Referenced by llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldInstruction(), getSizeOf(), llvm::IncrementCounterInBlock(), llvm::InsertProfilingInitCall(), llvm::MapValue(), llvm::BytecodeReader::ParseConstantValue(), RemapOperand(), and replaceUsesOfWithOnConstant(). |
|
Definition at line 1362 of file Constants.cpp. References llvm::ConstantFoldGetElementPtr(), llvm::GetElementPtrInst::getIndexedType(), and llvm::Value::getType(). Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and getGetElementPtr(). |
|
Definition at line 346 of file Constants.cpp. Referenced by llvm::ConstantFoldGetElementPtr(), and llvm::SCEVMulExpr::get(). |
|
ConstantExpr::get* - Return some common constants without having to specify the full Instruction::OPCODE identifier. Definition at line 329 of file Constants.cpp. References llvm::ConstantFP::get(), get(), llvm::Constant::getNullValue(), llvm::Value::getType(), and llvm::Type::isFloatingPoint(). Referenced by getNegativeSCEV(), and llvm::PatternMatch::neg_match< LHS_t >::match(). |
|
Definition at line 335 of file Constants.cpp. References get(), llvm::ConstantIntegral::getAllOnesValue(), and llvm::ISD::Xor. Referenced by llvm::PatternMatch::not_match< LHS_t >::match(). |
|
getOpcode - Return the opcode at the root of this constant expression
Definition at line 609 of file Constants.h. Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), DecomposeConstantExpr(), evaluateRelation(), getOpcodeName(), getValType(), and replaceUsesOfWithOnConstant(). |
|
getOpcodeName - Return a string representation for an opcode.
Definition at line 1410 of file Constants.cpp. References getOpcode(), and llvm::Instruction::getOpcodeName(). |
|
Reimplemented from llvm::Constant. Definition at line 622 of file Constants.h. References llvm::User::getOperand(). |
|
Override methods to provide more type information...
Reimplemented from llvm::Constant. Definition at line 619 of file Constants.h. References llvm::User::getOperand(). Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), DecomposeConstantExpr(), evaluateRelation(), GetGEPGlobalInitializer(), getValType(), and replaceUsesOfWithOnConstant(). |
|
Definition at line 358 of file Constants.cpp. References get(), and llvm::ISD::Or. |
|
Definition at line 352 of file Constants.cpp. References get(). |
|
Select constant expr Definition at line 556 of file Constants.h. References C, and getSelectTy(). Referenced by llvm::ConstantFoldInstruction(), llvm::MapValue(), llvm::BytecodeReader::ParseConstantValue(), RemapOperand(), and replaceUsesOfWithOnConstant(). |
|
Definition at line 1325 of file Constants.cpp. References llvm::Type::BoolTy, llvm::ConstantFoldSelectInstruction(), llvm::Value::getType(), llvm::Type::isFirstClassType(), and llvm::Instruction::Select. Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and getSelect(). |
|
Definition at line 364 of file Constants.cpp. References get(), and llvm::ISD::SetEQ. |
|
Definition at line 379 of file Constants.cpp. References get(), and llvm::ISD::SetGE. |
|
Definition at line 373 of file Constants.cpp. References get(), and llvm::ISD::SetGT. |
|
Definition at line 376 of file Constants.cpp. References get(), and llvm::ISD::SetLE. Referenced by LTE(). |
|
Definition at line 370 of file Constants.cpp. References get(), and llvm::ISD::SetLT. Referenced by LT(). |
|
Definition at line 367 of file Constants.cpp. References get(), and llvm::ISD::SetNE. |
|
getShiftTy - Return a shift left or shift right constant expr
Definition at line 1343 of file Constants.cpp. References llvm::ConstantFoldBinaryInstruction(), llvm::Value::getType(), llvm::Type::isIntegral(), llvm::Instruction::Shl, and llvm::Type::UByteTy. Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and getTy(). |
|
Definition at line 382 of file Constants.cpp. References get(), and llvm::Instruction::Shl. |
|
Definition at line 385 of file Constants.cpp. References get(). |
|
Definition at line 1241 of file Constants.cpp. References getCast(), llvm::Type::getPrimitiveSize(), llvm::Type::getSignedVersion(), llvm::Value::getType(), and llvm::Type::isInteger(). |
|
getSizeOf constant expr - computes the size of a type in a target independent way (Note: the return type is UInt but the object is not necessarily a ConstantUInt). Definition at line 1257 of file Constants.cpp. References llvm::ConstantInt::get(), llvm::PointerType::get(), getCast(), getGetElementPtr(), llvm::Constant::getNullValue(), and llvm::Type::UIntTy. |
|
Definition at line 395 of file Constants.cpp. References getCast(), getShr(), llvm::Type::getSignedVersion(), llvm::Value::getType(), and llvm::Type::isSigned(). |
|
Definition at line 343 of file Constants.cpp. References get(). Referenced by llvm::SCEVAddRecExpr::getNumIterationsInRange(), llvm::ConstantRange::getSetSize(), and llvm::ConstantRange::subtract(). |
|
Definition at line 1266 of file Constants.cpp. References llvm::Type::BoolTy, llvm::ConstantFoldBinaryInstruction(), getShiftTy(), llvm::Value::getType(), llvm::Instruction::isRelational(), and llvm::Instruction::Shl. Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and get(). |
|
Definition at line 389 of file Constants.cpp. References getCast(), getShr(), llvm::Value::getType(), llvm::Type::getUnsignedVersion(), and llvm::Type::isUnsigned(). |
|
Definition at line 361 of file Constants.cpp. References get(), and llvm::ISD::Xor. |
|
Definition at line 1249 of file Constants.cpp. References getCast(), llvm::Type::getPrimitiveSize(), llvm::Value::getType(), llvm::Type::getUnsignedVersion(), and llvm::Type::isInteger(). |
|
isNullValue - Return true if this is the value that would be returned by getNullValue. Implements llvm::Constant. Definition at line 606 of file Constants.h. |
|
replaceUsesOfWithOnConstant - This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does work on constants. Basically this method goes through the trouble of building a new constant that is equivalent to the current one, with all uses of From replaced with uses of To. After this construction is completed, all of the users of 'this' are replaced to use the new constant, and then 'this' is deleted. In general, you should not call this method, instead, use Value::replaceAllUsesWith, which automatically dispatches to this method as needed. Reimplemented from llvm::Constant. Definition at line 528 of file Constants.cpp. References llvm::Instruction::Cast, destroyConstant(), get(), getCast(), getGetElementPtr(), llvm::User::getNumOperands(), getOpcode(), getOperand(), getSelect(), llvm::Value::getType(), llvm::Value::replaceAllUsesWith(), llvm::Instruction::Select, and llvm::Value::uncheckedReplaceAllUsesWith(). |
|
Definition at line 517 of file Constants.h. |
|
Definition at line 518 of file Constants.h. |