aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2025-05-22 17:35:49 +0100
committerGitHub <noreply@github.com>2025-05-22 17:35:49 +0100
commit0ee40ca5ccbf036179ee11530cc91de7d31131aa (patch)
tree9f7c2058c143da7d8ca89cd870064a4ea2ed29d5 /clang/lib/CodeGen/CGExprAgg.cpp
parent28046438ed2f8c81d1dd5c49be0ea6c2bf169b64 (diff)
downloadllvm-0ee40ca5ccbf036179ee11530cc91de7d31131aa.zip
llvm-0ee40ca5ccbf036179ee11530cc91de7d31131aa.tar.gz
llvm-0ee40ca5ccbf036179ee11530cc91de7d31131aa.tar.bz2
[KeyInstr][Clang] Aggregate init + copy (#134639)
This patch is part of a stack that teaches Clang to generate Key Instructions metadata for C and C++. RFC: https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668 The feature is only functional in LLVM if LLVM is built with CMake flag LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index e6f1850..cad6731 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -1332,6 +1332,7 @@ static bool isBlockVarRef(const Expr *E) {
}
void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {
+ ApplyAtomGroup Grp(CGF.getDebugInfo());
// For an assignment to work, the value on the right has
// to be compatible with the value on the left.
assert(CGF.getContext().hasSameUnqualifiedType(E->getLHS()->getType(),
@@ -2393,7 +2394,8 @@ void CodeGenFunction::EmitAggregateCopy(LValue Dest, LValue Src, QualType Ty,
}
}
- auto Inst = Builder.CreateMemCpy(DestPtr, SrcPtr, SizeVal, isVolatile);
+ auto *Inst = Builder.CreateMemCpy(DestPtr, SrcPtr, SizeVal, isVolatile);
+ addInstToCurrentSourceAtom(Inst, nullptr);
// Determine the metadata to describe the position of any padding in this
// memcpy, as well as the TBAA tags for the members of the struct, in case