aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2022-09-03 13:12:49 -0700
committerVitaly Buka <vitalybuka@google.com>2022-09-03 13:12:49 -0700
commit9905dae5e18cd55ee6bb8678c95fed940ded1ef9 (patch)
tree56f85c024d3f3323466086d127ba9e2ded24b89b /clang/lib/CodeGen/CodeGenFunction.cpp
parent0e68f483d48d5d468addfd3a8c68a8862aa60222 (diff)
downloadllvm-9905dae5e18cd55ee6bb8678c95fed940ded1ef9.zip
llvm-9905dae5e18cd55ee6bb8678c95fed940ded1ef9.tar.gz
llvm-9905dae5e18cd55ee6bb8678c95fed940ded1ef9.tar.bz2
Revert "[Clang][CodeGen] Avoid __builtin_assume_aligned crash when the 1st arg is array type"
Breakes windows bot. This reverts commit 3ad2fe913ae08ca062105731ad2da2eae825c731.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 0b75f03..81c687e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2443,6 +2443,8 @@ void CodeGenFunction::emitAlignmentAssumption(llvm::Value *PtrValue,
SourceLocation AssumptionLoc,
llvm::Value *Alignment,
llvm::Value *OffsetValue) {
+ if (auto *CE = dyn_cast<CastExpr>(E))
+ E = CE->getSubExprAsWritten();
QualType Ty = E->getType();
SourceLocation Loc = E->getExprLoc();