mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
Remove the createInferredCast methods now that their last uses have been
removed. All casting is now explicit and not inferred by VMCore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32655 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8a903db499
commit
1bd82a5c65
@ -398,7 +398,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
/// Returns the opcode necessary to cast Val into Ty using usual casting
|
/// Returns the opcode necessary to cast Val into Ty using usual casting
|
||||||
/// rules.
|
/// rules.
|
||||||
|
/// @brief Infer the opcode for cast operand and type
|
||||||
static Instruction::CastOps getCastOpcode(
|
static Instruction::CastOps getCastOpcode(
|
||||||
const Value *Val, ///< The value to cast
|
const Value *Val, ///< The value to cast
|
||||||
bool SrcIsSigned, ///< Whether to treat the source as signed
|
bool SrcIsSigned, ///< Whether to treat the source as signed
|
||||||
@ -406,60 +407,6 @@ public:
|
|||||||
bool DstIsSigned ///< Whether to treate the dest. as signed
|
bool DstIsSigned ///< Whether to treate the dest. as signed
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Joins the create method (with insert-before-instruction semantics) above
|
|
||||||
/// with the getCastOpcode method. getOpcode(S,Ty) is called first to
|
|
||||||
/// obtain the opcode for casting S to type Ty. Then the get(...) method is
|
|
||||||
/// called to create the CastInst and insert it. The instruction is
|
|
||||||
/// inserted before InsertBefore (if it is non-null). The cast created is
|
|
||||||
/// inferred, because only the types involved are used in determining which
|
|
||||||
/// cast opcode to use. For specific casts, use one of the create methods.
|
|
||||||
/// @brief Inline helper method to join create with getCastOpcode.
|
|
||||||
inline static CastInst *createInferredCast(
|
|
||||||
Value *S, ///< The value to be casted (operand 0)
|
|
||||||
bool SrcIsSigned, ///< Whether to treat the source as signed
|
|
||||||
const Type *Ty, ///< Type to which operand should be casted
|
|
||||||
bool DstIsSigned, ///< Whether to treate the dest. as signed
|
|
||||||
const std::string &Name = "", ///< Name for the instruction
|
|
||||||
Instruction *InsertBefore = 0 ///< Place to insert the CastInst
|
|
||||||
) {
|
|
||||||
return create(getCastOpcode(S, SrcIsSigned, Ty, DstIsSigned),
|
|
||||||
S, Ty, Name, InsertBefore);
|
|
||||||
}
|
|
||||||
static CastInst *createInferredCast(
|
|
||||||
Value *S, ///< The value to be casted (operand 0)
|
|
||||||
const Type *Ty, ///< Type to which operand should be casted
|
|
||||||
const std::string &Name = "", ///< Name for the instruction
|
|
||||||
Instruction *InsertBefore = 0 ///< Place to insert the CastInst
|
|
||||||
);
|
|
||||||
|
|
||||||
/// Joins the get method (with insert-at-end-of-block semantics) method
|
|
||||||
/// above with the getCastOpcode method. getOpcode(S,Ty) is called first to
|
|
||||||
/// obtain the usual casting opcode for casting S to type Ty. Then the
|
|
||||||
/// get(...) method is called to create the CastInst and insert it. The
|
|
||||||
/// instruction is inserted at the end of InsertAtEnd (if it is non-null).
|
|
||||||
/// The created cast is inferred, because only the types involved are used
|
|
||||||
/// in determining which cast opcode to use. For specific casts, use one of
|
|
||||||
/// the create methods.
|
|
||||||
/// @brief Inline helper method to join create with getCastOpcode.
|
|
||||||
inline static CastInst *createInferredCast(
|
|
||||||
Value *S, ///< The value to be casted (operand 0)
|
|
||||||
bool SrcIsSigned, ///< Whether to treat the source as signed
|
|
||||||
const Type *Ty, ///< Type to which operand should be casted
|
|
||||||
bool DstIsSigned, ///< Whether to treate the dest. as signed
|
|
||||||
const std::string &Name, ///< Name for the instruction
|
|
||||||
BasicBlock *InsertAtEnd ///< The block to insert the instruction into
|
|
||||||
) {
|
|
||||||
return create(getCastOpcode(S, SrcIsSigned, Ty, DstIsSigned),
|
|
||||||
S, Ty, Name, InsertAtEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static CastInst *createInferredCast(
|
|
||||||
Value *S, ///< The value to be casted (operand 0)
|
|
||||||
const Type *Ty, ///< Type to which operand should be casted
|
|
||||||
const std::string &Name, ///< Name for the instruction
|
|
||||||
BasicBlock *InsertAtEnd ///< The block to insert the instruction into
|
|
||||||
);
|
|
||||||
|
|
||||||
/// There are several places where we need to know if a cast instruction
|
/// There are several places where we need to know if a cast instruction
|
||||||
/// only deals with integer source and destination types. To simplify that
|
/// only deals with integer source and destination types. To simplify that
|
||||||
/// logic, this method is provided.
|
/// logic, this method is provided.
|
||||||
|
@ -1782,20 +1782,6 @@ checkCast(Instruction::CastOps op, Value *S, const Type *DstTy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CastInst *CastInst::createInferredCast(
|
|
||||||
Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore)
|
|
||||||
{
|
|
||||||
return createInferredCast(S, S->getType()->isSigned(), Ty, Ty->isSigned(),
|
|
||||||
Name, InsertBefore);
|
|
||||||
}
|
|
||||||
|
|
||||||
CastInst *CastInst::createInferredCast(
|
|
||||||
Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
|
|
||||||
{
|
|
||||||
return createInferredCast(S, S->getType()->isSigned(), Ty, Ty->isSigned(),
|
|
||||||
Name, InsertAtEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
TruncInst::TruncInst(
|
TruncInst::TruncInst(
|
||||||
Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
|
Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
|
||||||
) : CastInst(Ty, Trunc, S, Name, InsertBefore) {
|
) : CastInst(Ty, Trunc, S, Name, InsertBefore) {
|
||||||
|
Loading…
Reference in New Issue
Block a user