diff options
author | Jordy Rose <jediknil@belkadan.com> | 2012-05-03 07:34:01 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2012-05-03 07:34:01 +0000 |
commit | d23232975fcd38b0ed64b8d12c5cacfe83e5aff0 (patch) | |
tree | b20f698e8740968011ed2b603e188d40751cb51e /clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | |
parent | cac46e87e9c7cd555ae24e9abd6ca16e1014231c (diff) | |
download | bcm5719-llvm-d23232975fcd38b0ed64b8d12c5cacfe83e5aff0.tar.gz bcm5719-llvm-d23232975fcd38b0ed64b8d12c5cacfe83e5aff0.zip |
[analyzer] Equality ops are like relational ops in that the arguments shouldn't be converted to the result type. Fixes PR12206 and dupe PR12510.
This was probably the original intent of r133041 (also me, a year ago).
llvm-svn: 156062
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp index 4a4fcf3c1fc..057b8c0adb8 100644 --- a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ b/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp @@ -345,7 +345,7 @@ SVal SimpleSValBuilder::evalBinOpNN(ProgramStateRef state, if (const llvm::APSInt *Constant = state->getSymVal(RSym)) { // The symbol evaluates to a constant. const llvm::APSInt *rhs_I; - if (BinaryOperator::isRelationalOp(op)) + if (BinaryOperator::isComparisonOp(op)) rhs_I = &BasicVals.Convert(lhsInt.getValue(), *Constant); else rhs_I = &BasicVals.Convert(resultTy, *Constant); @@ -494,7 +494,7 @@ SVal SimpleSValBuilder::evalBinOpNN(ProgramStateRef state, // The conversion type is usually the result type, but not in the case // of relational expressions. QualType conversionType = resultTy; - if (BinaryOperator::isRelationalOp(op)) + if (BinaryOperator::isComparisonOp(op)) conversionType = lhsType; // Does the symbol simplify to a constant? If so, "fold" the constant |