forked from OSchip/llvm-project
d55661db3c
Summary: As discussed in [[ https://bugs.llvm.org/show_bug.cgi?id=38166 | PR38166 ]], we need to be able to distinqush whether the cast we are visiting is actually a cast, or part of an `ExplicitCast`. There are at least four ways to get there: 1. Introduce a new `CastKind`, and use it instead of `IntegralCast` if we are in `ExplicitCast`. Would work, but does not scale - what if we will need more of these cast kinds? 2. Introduce a flag in `CastExprBits`, whether this cast is part of `ExplicitCast` or not. Would work, but it isn't immediately clear where it needs to be set. 2. Fix `ScalarExprEmitter::VisitCastExpr()` to visit these `NoOp` casts. As pointed out by @rsmith, CodeGenFunction::EmitMaterializeTemporaryExpr calls skipRValueSubobjectAdjustments, which steps over the CK_NoOp cast`, which explains why we currently don't visit those. This is probably impossible, as @efriedma points out, that is intentional as per `[class.temporary]` in the standard 3. And the simplest one, just record which NoOp casts we skip. It just kinda works as-is afterwards. But, the approach with a flag is the least intrusive one, and is probably the best one overall. Reviewers: rsmith, rjmccall, majnemer, efriedma Reviewed By: rsmith Subscribers: cfe-commits, aaron.ballman, vsk, llvm-commits, rsmith Differential Revision: https://reviews.llvm.org/D49508 llvm-svn: 337815 |
||
---|---|---|
.. | ||
access-qualifier.cl | ||
address-spaces-conversions-cl2.0.cl | ||
address-spaces.cl | ||
amdgpu-attrs.cl | ||
arithmetic-conversions.cl | ||
array-init.cl | ||
array-parameters.cl | ||
as_type.cl | ||
atomic-init.cl | ||
atomic-ops.cl | ||
bool-vectors.cl | ||
builtin.cl | ||
builtins-amdgcn-error-f16.cl | ||
builtins-amdgcn-error-gfx9.cl | ||
builtins-amdgcn-error.cl | ||
cl20-device-side-enqueue.cl | ||
clang-builtin-version.cl | ||
cond.cl | ||
convergent.cl | ||
endian-attr.cl | ||
event_t.cl | ||
event_t_overload.cl | ||
ext_vectors.cl | ||
extension-begin.cl | ||
extension-version.cl | ||
extensions.cl | ||
func.cl | ||
half.cl | ||
images.cl | ||
init.cl | ||
invalid-assignment-constant-address-space.cl | ||
invalid-block.cl | ||
invalid-clk-events-cl2.0.cl | ||
invalid-constant.cl | ||
invalid-image.cl | ||
invalid-kernel-attrs.cl | ||
invalid-kernel-parameters.cl | ||
invalid-kernel.cl | ||
invalid-pipe-builtin-cl2.0.cl | ||
invalid-pipes-cl2.0.cl | ||
lit.local.cfg | ||
logical-ops.cl | ||
multistep-explicit-cast.cl | ||
nosvm.cl | ||
null_literal.cl | ||
null_queue.cl | ||
pipes-1.2-negative.cl | ||
predefined-expr.cl | ||
queue_t_overload.cl | ||
sampler_t.cl | ||
sampler_t_overload.cl | ||
shifts.cl | ||
sizeof.cl | ||
storageclass-cl20.cl | ||
storageclass.cl | ||
str_literals.cl | ||
to_addr_builtin.cl | ||
types.cl | ||
unroll-hint.cl | ||
unsupported.cl | ||
vec_compare.cl | ||
vec_step.cl | ||
vector_conv_invalid.cl | ||
vector_inc_dec_ops.cl | ||
vector_literals_const.cl | ||
vector_literals_invalid.cl | ||
vector_swizzle_length.cl | ||
warn-missing-prototypes.cl |