Changeset View
Changeset View
Standalone View
Standalone View
cfe/trunk/lib/AST/Expr.cpp
Show First 20 Lines • Show All 1,856 Lines • ▼ Show 20 Lines | bool CastExpr::CastConsistency() const { | ||||
case CK_NonAtomicToAtomic: | case CK_NonAtomicToAtomic: | ||||
case CK_PointerToBoolean: | case CK_PointerToBoolean: | ||||
case CK_IntegralToBoolean: | case CK_IntegralToBoolean: | ||||
case CK_FloatingToBoolean: | case CK_FloatingToBoolean: | ||||
case CK_MemberPointerToBoolean: | case CK_MemberPointerToBoolean: | ||||
case CK_FloatingComplexToBoolean: | case CK_FloatingComplexToBoolean: | ||||
case CK_IntegralComplexToBoolean: | case CK_IntegralComplexToBoolean: | ||||
case CK_LValueBitCast: // -> bool& | case CK_LValueBitCast: // -> bool& | ||||
case CK_LValueToRValueBitCast: | |||||
case CK_UserDefinedConversion: // operator bool() | case CK_UserDefinedConversion: // operator bool() | ||||
case CK_BuiltinFnToFnPtr: | case CK_BuiltinFnToFnPtr: | ||||
case CK_FixedPointToBoolean: | case CK_FixedPointToBoolean: | ||||
CheckNoBasePath: | CheckNoBasePath: | ||||
assert(path_empty() && "Cast kind should not have a base path!"); | assert(path_empty() && "Cast kind should not have a base path!"); | ||||
break; | break; | ||||
} | } | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 1,628 Lines • ▼ Show 20 Lines | if (DCE->getTypeAsWritten()->isReferenceType() && | ||||
return true; | return true; | ||||
} | } | ||||
LLVM_FALLTHROUGH; | LLVM_FALLTHROUGH; | ||||
case ImplicitCastExprClass: | case ImplicitCastExprClass: | ||||
case CStyleCastExprClass: | case CStyleCastExprClass: | ||||
case CXXStaticCastExprClass: | case CXXStaticCastExprClass: | ||||
case CXXReinterpretCastExprClass: | case CXXReinterpretCastExprClass: | ||||
case CXXConstCastExprClass: | case CXXConstCastExprClass: | ||||
case CXXFunctionalCastExprClass: { | case CXXFunctionalCastExprClass: | ||||
case BuiltinBitCastExprClass: { | |||||
// While volatile reads are side-effecting in both C and C++, we treat them | // While volatile reads are side-effecting in both C and C++, we treat them | ||||
// as having possible (not definite) side-effects. This allows idiomatic | // as having possible (not definite) side-effects. This allows idiomatic | ||||
// code to behave without warning, such as sizeof(*v) for a volatile- | // code to behave without warning, such as sizeof(*v) for a volatile- | ||||
// qualified pointer. | // qualified pointer. | ||||
if (!IncludePossibleEffects) | if (!IncludePossibleEffects) | ||||
break; | break; | ||||
const CastExpr *CE = cast<CastExpr>(this); | const CastExpr *CE = cast<CastExpr>(this); | ||||
▲ Show 20 Lines • Show All 1,024 Lines • Show Last 20 Lines |