Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/CGExprScalar.cpp
Show First 20 Lines • Show All 1,959 Lines • ▼ Show 20 Lines | bool CodeGenFunction::ShouldNullCheckClassCastValue(const CastExpr *CE) { | ||||
if (isa<CXXThisExpr>(E->IgnoreParens())) { | if (isa<CXXThisExpr>(E->IgnoreParens())) { | ||||
// We always assume that 'this' is never null. | // We always assume that 'this' is never null. | ||||
return false; | return false; | ||||
} | } | ||||
if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(CE)) { | if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(CE)) { | ||||
// And that glvalue casts are never null. | // And that glvalue casts are never null. | ||||
if (ICE->getValueKind() != VK_PRValue) | if (ICE->isGLValue()) | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
// VisitCastExpr - Emit code for an explicit or implicit cast. Implicit casts | // VisitCastExpr - Emit code for an explicit or implicit cast. Implicit casts | ||||
// have to handle a more broad range of conversions than explicit casts, as they | // have to handle a more broad range of conversions than explicit casts, as they | ||||
▲ Show 20 Lines • Show All 3,156 Lines • Show Last 20 Lines |