diff options
author | Erich Keane <erich.keane@intel.com> | 2019-10-10 21:08:28 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2019-10-10 21:08:28 +0000 |
commit | 31e454c1ecac59273b4864990c8368c3e3fd16b6 (patch) | |
tree | 237e7522efda16adfe890a6f64b6d183416a976f /clang/lib/CodeGen/CGExprScalar.cpp | |
parent | 5e866e411caad4c4e17e7e0c67b06d28451e1bf2 (diff) | |
download | bcm5719-llvm-31e454c1ecac59273b4864990c8368c3e3fd16b6.tar.gz bcm5719-llvm-31e454c1ecac59273b4864990c8368c3e3fd16b6.zip |
Fix __builtin_assume_aligned with too large values.
Code to handle __builtin_assume_aligned was allowing larger values, but
would convert this to unsigned along the way. This patch removes the
EmitAssumeAligned overloads that take unsigned to do away with this
problem.
Additionally, it adds a warning that values greater than 1 <<29 are
ignored by LLVM.
Differential Revision: https://reviews.llvm.org/D68824
llvm-svn: 374450
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 0b9271b1d31..c7f279d28e8 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -294,8 +294,7 @@ public: Value *AlignmentValue = CGF.EmitScalarExpr(AVAttr->getAlignment()); llvm::ConstantInt *AlignmentCI = cast<llvm::ConstantInt>(AlignmentValue); - CGF.EmitAlignmentAssumption(V, E, AVAttr->getLocation(), - AlignmentCI->getZExtValue()); + CGF.EmitAlignmentAssumption(V, E, AVAttr->getLocation(), AlignmentCI); } /// EmitLoadOfLValue - Given an expression with complex type that represents a |