Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's constructor. The opcode must be in the CastOps category (Instruction::isCast(opcode) returns true). This constructor has insert-before-instruction semantics to automatically insert the new CastInst before InsertBefore (if it is non-null). Construct any of the CastInst subclasses
Declared in <llvm/IR/InstrTypes.h>
static
CastInst*
Create(
Instruction::CastOps,
Value* S,
Type* Ty,
Twine const& Name = "",
InsertPosition InsertBefore = nullptr);
This is the base class for all instructions that perform data casts. It is simply provided so that instruction category testing can be performed with code like:
| Name | Description |
|---|---|
| S | LLVM Value Representation |
| Ty | The instances of the Type class are immutable: once they are created, they are never changed. Also note that only one instance of a particular type is ever created. Thus seeing if two types are equal is a matter of doing a trivial pointer comparison. To enforce that no two equal instances are created, Type instances can only be created via static factory methods in class Type and in derived classes. Once allocated, Types are never free'd. |
| Name | Twine - A lightweight data structure for efficiently representing the concatenation of temporary values as strings. |