mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-27 17:31:33 +00:00
- Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but also accepts bool. SCVS: ---------------------------------------------------------------------- git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3572 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
625ea21205
commit
ce8a14915d
@ -169,12 +169,12 @@ inline Constant *operator^(const Constant &V1, const Constant &V2) {
|
|||||||
|
|
||||||
// Shift Instructions...
|
// Shift Instructions...
|
||||||
inline Constant *operator<<(const Constant &V1, const Constant &V2) {
|
inline Constant *operator<<(const Constant &V1, const Constant &V2) {
|
||||||
assert(V1.getType()->isIntegral() && V2.getType() == Type::UByteTy);
|
assert(V1.getType()->isInteger() && V2.getType() == Type::UByteTy);
|
||||||
return ConstRules::get(V1)->shl(&V1, &V2);
|
return ConstRules::get(V1)->shl(&V1, &V2);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Constant *operator>>(const Constant &V1, const Constant &V2) {
|
inline Constant *operator>>(const Constant &V1, const Constant &V2) {
|
||||||
assert(V1.getType()->isIntegral() && V2.getType() == Type::UByteTy);
|
assert(V1.getType()->isInteger() && V2.getType() == Type::UByteTy);
|
||||||
return ConstRules::get(V1)->shr(&V1, &V2);
|
return ConstRules::get(V1)->shr(&V1, &V2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,19 +121,28 @@ public:
|
|||||||
/// getDescription - Return the string representation of the type...
|
/// getDescription - Return the string representation of the type...
|
||||||
inline const std::string &getDescription() const { return Desc; }
|
inline const std::string &getDescription() const { return Desc; }
|
||||||
|
|
||||||
/// isSigned - Return whether a numeric type is signed.
|
/// isSigned - Return whether an integral numeric type is signed. This is
|
||||||
|
/// true for SByteTy, ShortTy, IntTy, LongTy. Note that this is not true for
|
||||||
|
/// Float and Double.
|
||||||
|
//
|
||||||
virtual bool isSigned() const { return 0; }
|
virtual bool isSigned() const { return 0; }
|
||||||
|
|
||||||
/// isUnsigned - Return whether a numeric type is unsigned. This is not
|
/// isUnsigned - Return whether a numeric type is unsigned. This is not quite
|
||||||
/// quite the complement of isSigned... nonnumeric types return false as they
|
/// the complement of isSigned... nonnumeric types return false as they do
|
||||||
/// do with isSigned.
|
/// with isSigned. This returns true for UByteTy, UShortTy, UIntTy, and
|
||||||
|
/// ULongTy
|
||||||
///
|
///
|
||||||
virtual bool isUnsigned() const { return 0; }
|
virtual bool isUnsigned() const { return 0; }
|
||||||
|
|
||||||
/// isIntegral - Equilivent to isSigned() || isUnsigned, but with only a
|
/// isInteger - Equilivent to isSigned() || isUnsigned(), but with only a
|
||||||
/// single virtual function invocation.
|
/// single virtual function invocation.
|
||||||
///
|
///
|
||||||
virtual bool isIntegral() const { return 0; }
|
virtual bool isInteger() const { return 0; }
|
||||||
|
|
||||||
|
/// isIntegral - Returns true if this is an integral type, which is either
|
||||||
|
/// BoolTy or one of the Integer types.
|
||||||
|
///
|
||||||
|
bool isIntegral() const { return isInteger() || this == BoolTy; }
|
||||||
|
|
||||||
/// isFloatingPoint - Return true if this is one of the two floating point
|
/// isFloatingPoint - Return true if this is one of the two floating point
|
||||||
/// types
|
/// types
|
||||||
|
@ -30,7 +30,7 @@ ExprType::ExprType(const ConstantInt *scale, Value *var,
|
|||||||
const ConstantInt *offset) {
|
const ConstantInt *offset) {
|
||||||
Scale = var ? scale : 0; Var = var; Offset = offset;
|
Scale = var ? scale : 0; Var = var; Offset = offset;
|
||||||
ExprTy = Scale ? ScaledLinear : (Var ? Linear : Constant);
|
ExprTy = Scale ? ScaledLinear : (Var ? Linear : Constant);
|
||||||
if (Scale && Scale->equalsInt(0)) { // Simplify 0*Var + const
|
if (Scale && Scale->isNullValue()) { // Simplify 0*Var + const
|
||||||
Scale = 0; Var = 0;
|
Scale = 0; Var = 0;
|
||||||
ExprTy = Constant;
|
ExprTy = Constant;
|
||||||
}
|
}
|
||||||
@ -245,9 +245,9 @@ ExprType ClassifyExpression(Value *Expr) {
|
|||||||
return Expr;
|
return Expr;
|
||||||
case Value::ConstantVal: // Constant value, just return constant
|
case Value::ConstantVal: // Constant value, just return constant
|
||||||
Constant *CPV = cast<Constant>(Expr);
|
Constant *CPV = cast<Constant>(Expr);
|
||||||
if (CPV->getType()->isIntegral()) { // It's an integral constant!
|
if (CPV->getType()->isInteger()) { // It's an integral constant!
|
||||||
ConstantInt *CPI = cast<ConstantInt>(Expr);
|
ConstantInt *CPI = cast<ConstantInt>(Expr);
|
||||||
return ExprType(CPI->equalsInt(0) ? 0 : CPI);
|
return ExprType(CPI->isNullValue() ? 0 : CPI);
|
||||||
}
|
}
|
||||||
return Expr;
|
return Expr;
|
||||||
}
|
}
|
||||||
|
@ -169,12 +169,12 @@ inline Constant *operator^(const Constant &V1, const Constant &V2) {
|
|||||||
|
|
||||||
// Shift Instructions...
|
// Shift Instructions...
|
||||||
inline Constant *operator<<(const Constant &V1, const Constant &V2) {
|
inline Constant *operator<<(const Constant &V1, const Constant &V2) {
|
||||||
assert(V1.getType()->isIntegral() && V2.getType() == Type::UByteTy);
|
assert(V1.getType()->isInteger() && V2.getType() == Type::UByteTy);
|
||||||
return ConstRules::get(V1)->shl(&V1, &V2);
|
return ConstRules::get(V1)->shl(&V1, &V2);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Constant *operator>>(const Constant &V1, const Constant &V2) {
|
inline Constant *operator>>(const Constant &V1, const Constant &V2) {
|
||||||
assert(V1.getType()->isIntegral() && V2.getType() == Type::UByteTy);
|
assert(V1.getType()->isInteger() && V2.getType() == Type::UByteTy);
|
||||||
return ConstRules::get(V1)->shr(&V1, &V2);
|
return ConstRules::get(V1)->shr(&V1, &V2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,12 +169,12 @@ inline Constant *operator^(const Constant &V1, const Constant &V2) {
|
|||||||
|
|
||||||
// Shift Instructions...
|
// Shift Instructions...
|
||||||
inline Constant *operator<<(const Constant &V1, const Constant &V2) {
|
inline Constant *operator<<(const Constant &V1, const Constant &V2) {
|
||||||
assert(V1.getType()->isIntegral() && V2.getType() == Type::UByteTy);
|
assert(V1.getType()->isInteger() && V2.getType() == Type::UByteTy);
|
||||||
return ConstRules::get(V1)->shl(&V1, &V2);
|
return ConstRules::get(V1)->shl(&V1, &V2);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Constant *operator>>(const Constant &V1, const Constant &V2) {
|
inline Constant *operator>>(const Constant &V1, const Constant &V2) {
|
||||||
assert(V1.getType()->isIntegral() && V2.getType() == Type::UByteTy);
|
assert(V1.getType()->isInteger() && V2.getType() == Type::UByteTy);
|
||||||
return ConstRules::get(V1)->shr(&V1, &V2);
|
return ConstRules::get(V1)->shr(&V1, &V2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user