mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Take a baby step towards getting rid of inferred casts. Provide methods on
CastInst and ConstantExpr that allow the signedness to be explicitly passed in and reliance on signedness removed from getCastOpcode. These are temporary measures useful during the conversion of inferred casts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -541,8 +541,15 @@ public:
|
||||
const Type *Ty ///< The type to which the constant is converted
|
||||
);
|
||||
|
||||
// This method uses the CastInst::getCastOpcode method to infer the
|
||||
// cast opcode to use.
|
||||
// @brief Get a ConstantExpr Conversion operator that casts C to Ty
|
||||
static Constant *getCast(Constant *C, const Type *Ty);
|
||||
static Constant *getInferredCast(Constant *C, bool SrcIsSigned,
|
||||
const Type *Ty, bool DestIsSigned);
|
||||
|
||||
static Constant *getCast(Constant *C, const Type *Ty) {
|
||||
return getInferredCast(C, C->getType()->isSigned(), Ty, Ty->isSigned());
|
||||
}
|
||||
|
||||
/// @brief Return true if this is a convert constant expression
|
||||
bool isCast() const;
|
||||
|
Reference in New Issue
Block a user