mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 07:16:40 +00:00
[KeyInstr] init-agg pattern
This commit is contained in:
parent
1f1f1d5d88
commit
3eae9188c3
@ -1220,6 +1220,7 @@ void CodeGenFunction::emitStoresForConstant(const VarDecl &D, Address Loc,
|
||||
}
|
||||
auto *I = Builder.CreateMemSet(
|
||||
Loc, llvm::ConstantInt::get(CGM.Int8Ty, Value), SizeVal, isVolatile);
|
||||
addInstToCurrentSourceAtom(I, nullptr);
|
||||
if (IsAutoInit)
|
||||
I->addAnnotationMetadata("auto-init");
|
||||
return;
|
||||
|
@ -6,7 +6,6 @@
|
||||
// store locations to be included in the atom group.
|
||||
|
||||
int g;
|
||||
char gc;
|
||||
void a() {
|
||||
// CHECK: _Z1av()
|
||||
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G1R1:!.*]]
|
||||
@ -24,9 +23,13 @@ void a() {
|
||||
// CHECK: store i8 99{{.*}}, !dbg [[G3R1]]
|
||||
// CHECK: store i8 100{{.*}}, !dbg [[G3R1]]
|
||||
char big[65536] = { 'a', 'b', 'c', 'd' };
|
||||
|
||||
// CHECK: call void @llvm.memset{{.*}}, !dbg [[G4R1:!.*]]
|
||||
char arr[] = { 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, };
|
||||
}
|
||||
|
||||
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
|
||||
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
|
||||
// CHECK: [[G2R2]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2)
|
||||
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
|
||||
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
|
||||
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user