LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
Transparently provide more efficient getOperand methods. | |
Function * | getFunction () const |
BasicBlock * | getBasicBlock () const |
void | destroyConstant () override |
void | replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) override |
Static Public Member Functions | |
static BlockAddress * | get (Function *F, BasicBlock *BB) |
get - Return a BlockAddress for the specified function and basic block. | |
static BlockAddress * | get (BasicBlock *BB) |
static BlockAddress * | lookup (const BasicBlock *BB) |
Lookup an existing BlockAddress constant for the given BasicBlock. | |
static bool | classof (const Value *V) |
Methods for support type inquiry through isa, cast, and dyn_cast: |
BlockAddress - The address of a basic block.
Definition at line 752 of file Constants.h.
static bool llvm::BlockAddress::classof | ( | const Value * | V | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:
Reimplemented from llvm::Constant.
Definition at line 780 of file Constants.h.
References llvm::Value::BlockAddressVal, and llvm::Value::getValueID().
Transparently provide more efficient getOperand methods.
void BlockAddress::destroyConstant | ( | ) | [override, virtual] |
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 1489 of file Constants.cpp.
References llvm::LLVMContextImpl::BlockAddresses, llvm::Constant::destroyConstantImpl(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), getBasicBlock(), llvm::Type::getContext(), getFunction(), llvm::GlobalValue::getType(), and llvm::LLVMContext::pImpl.
Referenced by llvm::MergeBasicBlockIntoOnlyPred(), and llvm::BasicBlock::~BasicBlock().
BlockAddress * BlockAddress::get | ( | Function * | F, |
BasicBlock * | BB | ||
) | [static] |
get - Return a BlockAddress for the specified function and basic block.
Definition at line 1457 of file Constants.cpp.
References llvm::LLVMContextImpl::BlockAddresses, llvm::Function::getContext(), getFunction(), and llvm::LLVMContext::pImpl.
Referenced by llvm::CloneFunctionInto(), hasAddressTakenAndUsed(), LLVMBlockAddress(), llvm::HexagonTargetLowering::LowerBR_JT(), llvm::MapValue(), and llvm::MergeBasicBlockIntoOnlyPred().
BlockAddress * BlockAddress::get | ( | BasicBlock * | BB | ) | [static] |
get - Return a BlockAddress for the specified basic block. The basic block must be embedded into a function.
Definition at line 1452 of file Constants.cpp.
References llvm::BasicBlock::getParent().
BasicBlock* llvm::BlockAddress::getBasicBlock | ( | ) | const [inline] |
Definition at line 774 of file Constants.h.
Referenced by destroyConstant(), llvm::AsmPrinter::GetBlockAddressSymbol(), replaceUsesOfWithOnConstant(), and SimplifyIndirectBrOnSelect().
Function* llvm::BlockAddress::getFunction | ( | ) | const [inline] |
Definition at line 773 of file Constants.h.
Referenced by destroyConstant(), get(), and replaceUsesOfWithOnConstant().
BlockAddress * BlockAddress::lookup | ( | const BasicBlock * | BB | ) | [static] |
Lookup an existing BlockAddress
constant for the given BasicBlock.
!BB->hasAddressTaken()
, otherwise the BlockAddress
. Definition at line 1475 of file Constants.cpp.
References llvm::LLVMContextImpl::BlockAddresses, llvm::Function::getContext(), llvm::BasicBlock::getParent(), llvm::BasicBlock::hasAddressTaken(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::lookup(), and llvm::LLVMContext::pImpl.
void BlockAddress::replaceUsesOfWithOnConstant | ( | Value * | , |
Value * | , | ||
Use * | |||
) | [override, virtual] |
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 1496 of file Constants.cpp.
References llvm::LLVMContextImpl::BlockAddresses, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), getBasicBlock(), llvm::Value::getContext(), getFunction(), llvm::LLVMContext::pImpl, llvm::Constant::replaceUsesOfWithOnConstantImpl(), llvm::User::setOperand(), and llvm::Value::stripPointerCasts().