aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authoryronglin <yronglin777@gmail.com>2022-09-03 23:24:37 +0800
committeryronglin <yronglin777@gmail.com>2022-09-03 23:26:01 +0800
commit3ad2fe913ae08ca062105731ad2da2eae825c731 (patch)
tree765b532ef34414b26d49e67116acb979aecc7089 /clang/lib/CodeGen/CodeGenFunction.cpp
parent5aee2726d8a6cb1698b11574ebb0e0499369a3d2 (diff)
downloadllvm-3ad2fe913ae08ca062105731ad2da2eae825c731.zip
llvm-3ad2fe913ae08ca062105731ad2da2eae825c731.tar.gz
llvm-3ad2fe913ae08ca062105731ad2da2eae825c731.tar.bz2
[Clang][CodeGen] Avoid __builtin_assume_aligned crash when the 1st arg is array type
Avoid __builtin_assume_aligned crash when the 1st arg is array type(or string literal). Open issue: https://github.com/llvm/llvm-project/issues/57169 Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D133202
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 81c687e..0b75f03 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2443,8 +2443,6 @@ 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();