diff options
author | John McCall <rjmccall@apple.com> | 2015-09-29 04:37:40 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2015-09-29 04:37:40 +0000 |
commit | 8460bcaa332df13fa3a83d2f62c65a4a14190970 (patch) | |
tree | 7abe3705a3aa4d8d061c25daa19389126981636a /clang/lib/CodeGen/CGExpr.cpp | |
parent | 8674c5cf70f6479132bc7dd63467b6c8c92c469d (diff) | |
download | bcm5719-llvm-8460bcaa332df13fa3a83d2f62c65a4a14190970.tar.gz bcm5719-llvm-8460bcaa332df13fa3a83d2f62c65a4a14190970.zip |
Honor the casted-to alignment of an explicit cast even when
Sema thinks the cast is a no-op, as it does when (e.g.) the
only thing that changes is an alignment attribute.
Fixed PR24944.
llvm-svn: 248775
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index c38dbdd7d30..ece83371db9 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -814,7 +814,6 @@ Address CodeGenFunction::EmitPointerWithAlignment(const Expr *E, // If this is an explicit bitcast, and the source l-value is // opaque, honor the alignment of the casted-to type. if (isa<ExplicitCastExpr>(CE) && - CE->getCastKind() == CK_BitCast && InnerSource != AlignmentSource::Decl) { Addr = Address(Addr.getPointer(), getNaturalPointeeTypeAlignment(E->getType(), Source)); |