mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-11 12:16:07 +00:00
[-Wunreachable-code] generalize configuration value checking to all comparison operators.
llvm-svn: 203016
This commit is contained in:
parent
6a56b21729
commit
3cdbc39a6e
@ -382,7 +382,7 @@ static bool isConfigurationValue(const Stmt *S) {
|
||||
return true;
|
||||
case Stmt::BinaryOperatorClass: {
|
||||
const BinaryOperator *B = cast<BinaryOperator>(S);
|
||||
return (B->isLogicalOp() || B->isRelationalOp()) &&
|
||||
return (B->isLogicalOp() || B->isComparisonOp()) &&
|
||||
(isConfigurationValue(B->getLHS()) ||
|
||||
isConfigurationValue(B->getRHS()));
|
||||
}
|
||||
|
@ -226,3 +226,11 @@ int test_config_constant(int x) {
|
||||
calledFun(); // expected-warning {{will never be executed}}
|
||||
}
|
||||
|
||||
int sizeof_int() {
|
||||
if (sizeof(long) == sizeof(int))
|
||||
return 1; // no-warning
|
||||
if (sizeof(long) != sizeof(int))
|
||||
return 0; // no-warning
|
||||
return 2; // no-warning
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user