diff options
author | Chris Lattner <sabre@nondot.org> | 2002-09-03 01:05:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-09-03 01:05:48 +0000 |
commit | ce8a14915d2971039b576e03a32e0ba7c421dba7 (patch) | |
tree | 148593a8f58b5bbac0171ded5dcf3e9e60b2eee5 /lib/Analysis/Expressions.cpp | |
parent | 625ea21205d1fb6f175e22477f55dd485b7c65c4 (diff) |
- 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
Diffstat (limited to 'lib/Analysis/Expressions.cpp')
-rw-r--r-- | lib/Analysis/Expressions.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/Expressions.cpp b/lib/Analysis/Expressions.cpp index 7901b1421e..14ba9c8e9d 100644 --- a/lib/Analysis/Expressions.cpp +++ b/lib/Analysis/Expressions.cpp @@ -30,7 +30,7 @@ ExprType::ExprType(const ConstantInt *scale, Value *var, const ConstantInt *offset) { Scale = var ? scale : 0; Var = var; Offset = offset; 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; ExprTy = Constant; } @@ -245,9 +245,9 @@ ExprType ClassifyExpression(Value *Expr) { return Expr; case Value::ConstantVal: // Constant value, just return constant 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); - return ExprType(CPI->equalsInt(0) ? 0 : CPI); + return ExprType(CPI->isNullValue() ? 0 : CPI); } return Expr; } |