From 9905dae5e18cd55ee6bb8678c95fed940ded1ef9 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Sat, 3 Sep 2022 13:12:49 -0700 Subject: Revert "[Clang][CodeGen] Avoid __builtin_assume_aligned crash when the 1st arg is array type" Breakes windows bot. This reverts commit 3ad2fe913ae08ca062105731ad2da2eae825c731. --- clang/lib/CodeGen/CodeGenFunction.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') 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(E)) + E = CE->getSubExprAsWritten(); QualType Ty = E->getType(); SourceLocation Loc = E->getExprLoc(); -- cgit v1.1