Skip to content

Commit a4aff05

Browse files
committed
[cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks
This connects the -fsanitize-annotate-debug-info plumbing (llvm#138577) to CFI check codegen. Updates the tests from llvm#139149. A side effect is that __ubsan_check_array_bounds is renamed to __ubsan_check_array-bounds. This affects clang/test/CodeGen/bounds-checking-debuginfo.c from llvm#128977
1 parent dae5c4e commit a4aff05

File tree

8 files changed

+166
-96
lines changed

8 files changed

+166
-96
lines changed

clang/lib/CodeGen/CGClass.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2814,6 +2814,10 @@ void CodeGenFunction::EmitVTablePtrCheckForCall(const CXXRecordDecl *RD,
28142814
if (!SanOpts.has(SanitizerKind::CFICastStrict))
28152815
RD = LeastDerivedClassWithSameLayout(RD);
28162816

2817+
SanitizerKind::SanitizerOrdinal Ordinal;
2818+
llvm::SanitizerStatKind SSK;
2819+
ParseCFITypeCheckKind(TCK, Ordinal, SSK);
2820+
ApplyDebugLocation ApplyTrapDI(*this, SanitizerAnnotateDebugInfo(Ordinal));
28172821
EmitVTablePtrCheck(RD, VTable, TCK, Loc);
28182822
}
28192823

@@ -2836,6 +2840,11 @@ void CodeGenFunction::EmitVTablePtrCheckForCast(QualType T, Address Derived,
28362840
if (!SanOpts.has(SanitizerKind::CFICastStrict))
28372841
ClassDecl = LeastDerivedClassWithSameLayout(ClassDecl);
28382842

2843+
SanitizerKind::SanitizerOrdinal Ordinal;
2844+
llvm::SanitizerStatKind SSK;
2845+
ParseCFITypeCheckKind(TCK, Ordinal, SSK);
2846+
ApplyDebugLocation ApplyTrapDI(*this, SanitizerAnnotateDebugInfo(Ordinal));
2847+
28392848
llvm::BasicBlock *ContBlock = nullptr;
28402849

28412850
if (MayBeNull) {
@@ -2871,7 +2880,6 @@ void CodeGenFunction::EmitVTablePtrCheck(const CXXRecordDecl *RD,
28712880
return;
28722881

28732882
auto [M, SSK] = SanitizerInfoFromCFICheckKind(TCK);
2874-
28752883
std::string TypeName = RD->getQualifiedNameAsString();
28762884
if (getContext().getNoSanitizeList().containsType(
28772885
SanitizerMask::bitPosToMask(M), TypeName))
@@ -2937,6 +2945,8 @@ llvm::Value *CodeGenFunction::EmitVTableTypeCheckedLoad(
29372945
SanitizerScope SanScope(this);
29382946

29392947
EmitSanitizerStatReport(llvm::SanStat_CFI_VCall);
2948+
ApplyDebugLocation ApplyTrapDI(
2949+
*this, SanitizerAnnotateDebugInfo(SanitizerKind::SO_CFIVCall));
29402950

29412951
llvm::Metadata *MD =
29422952
CGM.CreateMetadataIdentifierForType(QualType(RD->getTypeForDecl(), 0));

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,30 @@ void CodeGenFunction::EmitBoundsCheck(const Expr *E, const Expr *Base,
12171217
EmitBoundsCheckImpl(E, Bound, Index, IndexType, IndexedType, Accessed);
12181218
}
12191219

1220+
llvm::DILocation *CodeGenFunction::SanitizerAnnotateDebugInfo(
1221+
SanitizerKind::SanitizerOrdinal CheckKindOrdinal) {
1222+
StringRef Label;
1223+
switch (CheckKindOrdinal) {
1224+
#define SANITIZER(NAME, ID) \
1225+
case SanitizerKind::SO_##ID: \
1226+
Label = "__ubsan_check_" NAME; \
1227+
break;
1228+
#include "clang/Basic/Sanitizers.def"
1229+
default:
1230+
llvm_unreachable("unexpected sanitizer kind");
1231+
}
1232+
1233+
llvm::DILocation *CheckDI = Builder.getCurrentDebugLocation();
1234+
// TODO: deprecate ClArrayBoundsPseudoFn
1235+
if (((ClArrayBoundsPseudoFn &&
1236+
CheckKindOrdinal == SanitizerKind::SO_ArrayBounds) ||
1237+
CGM.getCodeGenOpts().SanitizeAnnotateDebugInfo.has(CheckKindOrdinal)) &&
1238+
CheckDI) {
1239+
CheckDI = getDebugInfo()->CreateSyntheticInlineAt(CheckDI, Label);
1240+
}
1241+
return CheckDI;
1242+
}
1243+
12201244
void CodeGenFunction::EmitBoundsCheckImpl(const Expr *E, llvm::Value *Bound,
12211245
llvm::Value *Index,
12221246
QualType IndexType,
@@ -1225,7 +1249,6 @@ void CodeGenFunction::EmitBoundsCheckImpl(const Expr *E, llvm::Value *Bound,
12251249
return;
12261250

12271251
SanitizerScope SanScope(this);
1228-
12291252
auto CheckKind = SanitizerKind::SO_ArrayBounds;
12301253
ApplyDebugLocation ApplyTrapDI(*this, SanitizerAnnotateDebugInfo(CheckKind));
12311254

@@ -3971,6 +3994,8 @@ void CodeGenFunction::EmitCfiCheckFail() {
39713994
{Addr, AllVtables}),
39723995
IntPtrTy);
39733996

3997+
// TODO: the instructions above are not annotated with debug info. It is
3998+
// inconvenient to do so because we hadn't determined the SanitizerKind yet.
39743999
const std::pair<int, SanitizerKind::SanitizerOrdinal> CheckKinds[] = {
39754000
{CFITCK_VCall, SanitizerKind::SO_CFIVCall},
39764001
{CFITCK_NVCall, SanitizerKind::SO_CFINVCall},
@@ -3981,6 +4006,9 @@ void CodeGenFunction::EmitCfiCheckFail() {
39814006
for (auto CheckKindOrdinalPair : CheckKinds) {
39824007
int Kind = CheckKindOrdinalPair.first;
39834008
SanitizerKind::SanitizerOrdinal Ordinal = CheckKindOrdinalPair.second;
4009+
4010+
ApplyDebugLocation ApplyTrapDI(*this, SanitizerAnnotateDebugInfo(Ordinal));
4011+
39844012
llvm::Value *Cond =
39854013
Builder.CreateICmpNE(CheckKind, llvm::ConstantInt::get(Int8Ty, Kind));
39864014
if (CGM.getLangOpts().Sanitize.has(Ordinal))
@@ -6315,6 +6343,8 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType,
63156343
(!TargetDecl || !isa<FunctionDecl>(TargetDecl))) {
63166344
SanitizerScope SanScope(this);
63176345
EmitSanitizerStatReport(llvm::SanStat_CFI_ICall);
6346+
ApplyDebugLocation ApplyTrapDI(
6347+
*this, SanitizerAnnotateDebugInfo(SanitizerKind::SO_CFIICall));
63186348

63196349
llvm::Metadata *MD;
63206350
if (CGM.getCodeGenOpts().SanitizeCfiICallGeneralizePointers)

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3358,6 +3358,17 @@ class CodeGenFunction : public CodeGenTypeCache {
33583358
SanitizerSet SkippedChecks = SanitizerSet(),
33593359
llvm::Value *ArraySize = nullptr);
33603360

3361+
/// Returns debug info, with additional annotation if enabled by
3362+
/// CGM.getCodeGenOpts().SanitizeAnnotateDebugInfo[CheckKindOrdinal].
3363+
llvm::DILocation *
3364+
SanitizerAnnotateDebugInfo(SanitizerKind::SanitizerOrdinal CheckKindOrdinal);
3365+
3366+
/// Converts the CFITypeCheckKind into SanitizerKind::SanitizerOrdinal and
3367+
/// llvm::SanitizerStatKind.
3368+
void ParseCFITypeCheckKind(CFITypeCheckKind TCK,
3369+
SanitizerKind::SanitizerOrdinal &M,
3370+
llvm::SanitizerStatKind &SSK);
3371+
33613372
/// Emit a check that \p Base points into an array object, which
33623373
/// we can access at index \p Index. \p Accessed should be \c false if we
33633374
/// this expression is used as an lvalue, for instance in "&Arr[Idx]".

clang/lib/CodeGen/ItaniumCXXABI.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ CGCallee ItaniumCXXABI::EmitLoadOfMemberFunctionPointer(
703703

704704
{
705705
CodeGenFunction::SanitizerScope SanScope(&CGF);
706+
ApplyDebugLocation ApplyTrapDI(
707+
CGF, CGF.SanitizerAnnotateDebugInfo(SanitizerKind::SO_CFIMFCall));
708+
706709
llvm::Value *TypeId = nullptr;
707710
llvm::Value *CheckResult = nullptr;
708711

@@ -792,14 +795,16 @@ CGCallee ItaniumCXXABI::EmitLoadOfMemberFunctionPointer(
792795
// In the non-virtual path, the function pointer is actually a
793796
// function pointer.
794797
CGF.EmitBlock(FnNonVirtual);
798+
795799
llvm::Value *NonVirtualFn =
796800
Builder.CreateIntToPtr(FnAsInt, CGF.UnqualPtrTy, "memptr.nonvirtualfn");
797-
798801
// Check the function pointer if CFI on member function pointers is enabled.
799802
if (ShouldEmitCFICheck) {
800803
CXXRecordDecl *RD = MPT->getMostRecentCXXRecordDecl();
801804
if (RD->hasDefinition()) {
802805
CodeGenFunction::SanitizerScope SanScope(&CGF);
806+
ApplyDebugLocation ApplyTrapDI(
807+
CGF, CGF.SanitizerAnnotateDebugInfo(SanitizerKind::SO_CFIMFCall));
803808

804809
llvm::Constant *StaticData[] = {
805810
llvm::ConstantInt::get(CGF.Int8Ty, CodeGenFunction::CFITCK_NVMFCall),

clang/test/CodeGen/bounds-checking-debuginfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ double f1(int b, int i) {
8989
// CHECK-TRAP: [[DBG21]] = !DILocation(line: 65, column: 3, scope: [[DBG4]])
9090
// CHECK-TRAP: [[DBG22]] = !DILocation(line: 66, column: 12, scope: [[DBG4]])
9191
// CHECK-TRAP: [[DBG23]] = !DILocation(line: 0, scope: [[META24:![0-9]+]], inlinedAt: [[DBG26]])
92-
// CHECK-TRAP: [[META24]] = distinct !DISubprogram(name: "__ubsan_check_array_bounds", scope: [[META5]], file: [[META5]], type: [[META25:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: [[META0]])
92+
// CHECK-TRAP: [[META24]] = distinct !DISubprogram(name: "__ubsan_check_array-bounds", scope: [[META5]], file: [[META5]], type: [[META25:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: [[META0]])
9393
// CHECK-TRAP: [[META25]] = !DISubroutineType(types: null)
9494
// CHECK-TRAP: [[DBG26]] = !DILocation(line: 66, column: 10, scope: [[DBG4]])
9595
// CHECK-TRAP: [[PROF27]] = !{!"branch_weights", i32 1048575, i32 1}
@@ -117,7 +117,7 @@ double f1(int b, int i) {
117117
// CHECK-NOTRAP: [[DBG21]] = !DILocation(line: 65, column: 3, scope: [[DBG4]])
118118
// CHECK-NOTRAP: [[DBG22]] = !DILocation(line: 66, column: 12, scope: [[DBG4]])
119119
// CHECK-NOTRAP: [[DBG23]] = !DILocation(line: 0, scope: [[META24:![0-9]+]], inlinedAt: [[DBG26]])
120-
// CHECK-NOTRAP: [[META24]] = distinct !DISubprogram(name: "__ubsan_check_array_bounds", scope: [[META5]], file: [[META5]], type: [[META25:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: [[META0]])
120+
// CHECK-NOTRAP: [[META24]] = distinct !DISubprogram(name: "__ubsan_check_array-bounds", scope: [[META5]], file: [[META5]], type: [[META25:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: [[META0]])
121121
// CHECK-NOTRAP: [[META25]] = !DISubroutineType(types: null)
122122
// CHECK-NOTRAP: [[DBG26]] = !DILocation(line: 66, column: 10, scope: [[DBG4]])
123123
// CHECK-NOTRAP: [[PROF27]] = !{!"branch_weights", i32 1048575, i32 1}

clang/test/CodeGen/cfi-check-fail-debuginfo.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
// CHECK-SAME: ptr noundef [[F:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] !dbg [[DBG7:![0-9]+]] !type [[META16:![0-9]+]] !type [[META17:![0-9]+]] !type [[META18:![0-9]+]] {
1111
// CHECK-NEXT: [[ENTRY:.*:]]
1212
// CHECK-NEXT: #dbg_value(ptr [[F]], [[META15:![0-9]+]], !DIExpression(), [[META19:![0-9]+]])
13-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.type.test(ptr [[F]], metadata !"_ZTSFvvE"), !dbg [[DBG20:![0-9]+]], !nosanitize [[META21:![0-9]+]]
14-
// CHECK-NEXT: br i1 [[TMP0]], label %[[CFI_CONT:.*]], label %[[CFI_SLOWPATH:.*]], !dbg [[DBG20]], !prof [[PROF22:![0-9]+]], !nosanitize [[META21]]
13+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.type.test(ptr [[F]], metadata !"_ZTSFvvE"), !dbg [[DBG20:![0-9]+]], !nosanitize [[META24:![0-9]+]]
14+
// CHECK-NEXT: br i1 [[TMP0]], label %[[CFI_CONT:.*]], label %[[CFI_SLOWPATH:.*]], !dbg [[DBG20]], !prof [[PROF25:![0-9]+]], !nosanitize [[META24]]
1515
// CHECK: [[CFI_SLOWPATH]]:
16-
// CHECK-NEXT: tail call void @__cfi_slowpath(i64 9080559750644022485, ptr [[F]]) #[[ATTR6:[0-9]+]], !dbg [[DBG20]], !nosanitize [[META21]]
17-
// CHECK-NEXT: br label %[[CFI_CONT]], !dbg [[DBG20]], !nosanitize [[META21]]
16+
// CHECK-NEXT: tail call void @__cfi_slowpath(i64 9080559750644022485, ptr [[F]]) #[[ATTR6:[0-9]+]], !dbg [[DBG20]], !nosanitize [[META24]]
17+
// CHECK-NEXT: br label %[[CFI_CONT]], !dbg [[DBG20]], !nosanitize [[META24]]
1818
// CHECK: [[CFI_CONT]]:
19-
// CHECK-NEXT: tail call void [[F]]() #[[ATTR6]], !dbg [[DBG20]]
20-
// CHECK-NEXT: ret void, !dbg [[DBG23:![0-9]+]]
19+
// CHECK-NEXT: tail call void [[F]]() #[[ATTR6]], !dbg [[DBG23:![0-9]+]]
20+
// CHECK-NEXT: ret void, !dbg [[DBG26:![0-9]+]]
2121
//
2222
void caller(void (*f)(void)) {
2323
f();
@@ -38,8 +38,11 @@ void caller(void (*f)(void)) {
3838
// CHECK: [[META17]] = !{i64 0, !"_ZTSFvPvE.generalized"}
3939
// CHECK: [[META18]] = !{i64 0, i64 2451761621477796417}
4040
// CHECK: [[META19]] = !DILocation(line: 0, scope: [[DBG7]])
41-
// CHECK: [[DBG20]] = !DILocation(line: 23, column: 3, scope: [[DBG7]])
42-
// CHECK: [[META21]] = !{}
43-
// CHECK: [[PROF22]] = !{!"branch_weights", i32 1048575, i32 1}
44-
// CHECK: [[DBG23]] = !DILocation(line: 24, column: 1, scope: [[DBG7]])
41+
// CHECK: [[DBG20]] = !DILocation(line: 0, scope: [[META21:![0-9]+]], inlinedAt: [[DBG23]])
42+
// CHECK: [[META21]] = distinct !DISubprogram(name: "__ubsan_check_cfi-icall", scope: [[META8]], file: [[META8]], type: [[META22:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: [[META0]])
43+
// CHECK: [[META22]] = !DISubroutineType(types: null)
44+
// CHECK: [[DBG23]] = !DILocation(line: 23, column: 3, scope: [[DBG7]])
45+
// CHECK: [[META24]] = !{}
46+
// CHECK: [[PROF25]] = !{!"branch_weights", i32 1048575, i32 1}
47+
// CHECK: [[DBG26]] = !DILocation(line: 24, column: 1, scope: [[DBG7]])
4548
//.

clang/test/CodeGen/cfi-icall-generalize-debuginfo.c

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@ int** f(const char *a, const char **b) {
2727
// UNGENERALIZED-SAME: ptr noundef [[FP:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] !dbg [[DBG25:![0-9]+]] !type [[META31:![0-9]+]] !type [[META32:![0-9]+]] {
2828
// UNGENERALIZED-NEXT: [[ENTRY:.*:]]
2929
// UNGENERALIZED-NEXT: #dbg_value(ptr [[FP]], [[META30:![0-9]+]], !DIExpression(), [[META33:![0-9]+]])
30-
// UNGENERALIZED-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.type.test(ptr [[FP]], metadata !"_ZTSFPPiPKcPS2_E"), !dbg [[DBG34:![0-9]+]], !nosanitize [[META35:![0-9]+]]
31-
// UNGENERALIZED-NEXT: br i1 [[TMP0]], label %[[CONT:.*]], label %[[TRAP:.*]], !dbg [[DBG34]], !prof [[PROF36:![0-9]+]], !nosanitize [[META35]]
30+
// UNGENERALIZED-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.type.test(ptr [[FP]], metadata !"_ZTSFPPiPKcPS2_E"), !dbg [[DBG34:![0-9]+]], !nosanitize [[META38:![0-9]+]]
31+
// UNGENERALIZED-NEXT: br i1 [[TMP0]], label %[[CONT:.*]], label %[[TRAP:.*]], !dbg [[DBG34]], !prof [[PROF39:![0-9]+]], !nosanitize [[META38]]
3232
// UNGENERALIZED: [[TRAP]]:
33-
// UNGENERALIZED-NEXT: tail call void @llvm.ubsantrap(i8 2) #[[ATTR4:[0-9]+]], !dbg [[DBG34]], !nosanitize [[META35]]
34-
// UNGENERALIZED-NEXT: unreachable, !dbg [[DBG34]], !nosanitize [[META35]]
33+
// UNGENERALIZED-NEXT: tail call void @llvm.ubsantrap(i8 2) #[[ATTR4:[0-9]+]], !dbg [[DBG34]], !nosanitize [[META38]]
34+
// UNGENERALIZED-NEXT: unreachable, !dbg [[DBG34]], !nosanitize [[META38]]
3535
// UNGENERALIZED: [[CONT]]:
36-
// UNGENERALIZED-NEXT: [[CALL:%.*]] = tail call ptr [[FP]](ptr noundef null, ptr noundef null) #[[ATTR5:[0-9]+]], !dbg [[DBG34]]
37-
// UNGENERALIZED-NEXT: ret void, !dbg [[DBG37:![0-9]+]]
36+
// UNGENERALIZED-NEXT: [[CALL:%.*]] = tail call ptr [[FP]](ptr noundef null, ptr noundef null) #[[ATTR5:[0-9]+]], !dbg [[DBG37:![0-9]+]]
37+
// UNGENERALIZED-NEXT: ret void, !dbg [[DBG40:![0-9]+]]
3838
//
3939
// GENERALIZED-LABEL: define dso_local void @g(
4040
// GENERALIZED-SAME: ptr noundef [[FP:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] !dbg [[DBG25:![0-9]+]] !type [[META31:![0-9]+]] !type [[META32:![0-9]+]] {
4141
// GENERALIZED-NEXT: [[ENTRY:.*:]]
4242
// GENERALIZED-NEXT: #dbg_value(ptr [[FP]], [[META30:![0-9]+]], !DIExpression(), [[META33:![0-9]+]])
43-
// GENERALIZED-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.type.test(ptr [[FP]], metadata !"_ZTSFPvPKvS_E.generalized"), !dbg [[DBG34:![0-9]+]], !nosanitize [[META35:![0-9]+]]
44-
// GENERALIZED-NEXT: br i1 [[TMP0]], label %[[CONT:.*]], label %[[TRAP:.*]], !dbg [[DBG34]], !prof [[PROF36:![0-9]+]], !nosanitize [[META35]]
43+
// GENERALIZED-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.type.test(ptr [[FP]], metadata !"_ZTSFPvPKvS_E.generalized"), !dbg [[DBG34:![0-9]+]], !nosanitize [[META38:![0-9]+]]
44+
// GENERALIZED-NEXT: br i1 [[TMP0]], label %[[CONT:.*]], label %[[TRAP:.*]], !dbg [[DBG34]], !prof [[PROF39:![0-9]+]], !nosanitize [[META38]]
4545
// GENERALIZED: [[TRAP]]:
46-
// GENERALIZED-NEXT: tail call void @llvm.ubsantrap(i8 2) #[[ATTR4:[0-9]+]], !dbg [[DBG34]], !nosanitize [[META35]]
47-
// GENERALIZED-NEXT: unreachable, !dbg [[DBG34]], !nosanitize [[META35]]
46+
// GENERALIZED-NEXT: tail call void @llvm.ubsantrap(i8 2) #[[ATTR4:[0-9]+]], !dbg [[DBG34]], !nosanitize [[META38]]
47+
// GENERALIZED-NEXT: unreachable, !dbg [[DBG34]], !nosanitize [[META38]]
4848
// GENERALIZED: [[CONT]]:
49-
// GENERALIZED-NEXT: [[CALL:%.*]] = tail call ptr [[FP]](ptr noundef null, ptr noundef null) #[[ATTR5:[0-9]+]], !dbg [[DBG34]]
50-
// GENERALIZED-NEXT: ret void, !dbg [[DBG37:![0-9]+]]
49+
// GENERALIZED-NEXT: [[CALL:%.*]] = tail call ptr [[FP]](ptr noundef null, ptr noundef null) #[[ATTR5:[0-9]+]], !dbg [[DBG37:![0-9]+]]
50+
// GENERALIZED-NEXT: ret void, !dbg [[DBG40:![0-9]+]]
5151
//
5252
void g(int** (*fp)(const char *, const char **)) {
5353
fp(0, 0);
@@ -84,10 +84,13 @@ void g(int** (*fp)(const char *, const char **)) {
8484
// UNGENERALIZED: [[META31]] = !{i64 0, !"_ZTSFvPFPPiPKcPS2_EE"}
8585
// UNGENERALIZED: [[META32]] = !{i64 0, !"_ZTSFvPvE.generalized"}
8686
// UNGENERALIZED: [[META33]] = !DILocation(line: 0, scope: [[DBG25]])
87-
// UNGENERALIZED: [[DBG34]] = !DILocation(line: 53, column: 3, scope: [[DBG25]])
88-
// UNGENERALIZED: [[META35]] = !{}
89-
// UNGENERALIZED: [[PROF36]] = !{!"branch_weights", i32 1048575, i32 1}
90-
// UNGENERALIZED: [[DBG37]] = !DILocation(line: 54, column: 1, scope: [[DBG25]])
87+
// UNGENERALIZED: [[DBG34]] = !DILocation(line: 0, scope: [[META35:![0-9]+]], inlinedAt: [[DBG37]])
88+
// UNGENERALIZED: [[META35]] = distinct !DISubprogram(name: "__ubsan_check_cfi-icall", scope: [[META11]], file: [[META11]], type: [[META36:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: [[META0]])
89+
// UNGENERALIZED: [[META36]] = !DISubroutineType(types: null)
90+
// UNGENERALIZED: [[DBG37]] = !DILocation(line: 53, column: 3, scope: [[DBG25]])
91+
// UNGENERALIZED: [[META38]] = !{}
92+
// UNGENERALIZED: [[PROF39]] = !{!"branch_weights", i32 1048575, i32 1}
93+
// UNGENERALIZED: [[DBG40]] = !DILocation(line: 54, column: 1, scope: [[DBG25]])
9194
//.
9295
// GENERALIZED: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: [[META2:![0-9]+]], splitDebugInlining: false, nameTableKind: None)
9396
// GENERALIZED: [[META1]] = !DIFile(filename: "{{.*}}<stdin>", directory: {{.*}})
@@ -119,8 +122,11 @@ void g(int** (*fp)(const char *, const char **)) {
119122
// GENERALIZED: [[META31]] = !{i64 0, !"_ZTSFvPFPPiPKcPS2_EE"}
120123
// GENERALIZED: [[META32]] = !{i64 0, !"_ZTSFvPvE.generalized"}
121124
// GENERALIZED: [[META33]] = !DILocation(line: 0, scope: [[DBG25]])
122-
// GENERALIZED: [[DBG34]] = !DILocation(line: 53, column: 3, scope: [[DBG25]])
123-
// GENERALIZED: [[META35]] = !{}
124-
// GENERALIZED: [[PROF36]] = !{!"branch_weights", i32 1048575, i32 1}
125-
// GENERALIZED: [[DBG37]] = !DILocation(line: 54, column: 1, scope: [[DBG25]])
125+
// GENERALIZED: [[DBG34]] = !DILocation(line: 0, scope: [[META35:![0-9]+]], inlinedAt: [[DBG37]])
126+
// GENERALIZED: [[META35]] = distinct !DISubprogram(name: "__ubsan_check_cfi-icall", scope: [[META11]], file: [[META11]], type: [[META36:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: [[META0]])
127+
// GENERALIZED: [[META36]] = !DISubroutineType(types: null)
128+
// GENERALIZED: [[DBG37]] = !DILocation(line: 53, column: 3, scope: [[DBG25]])
129+
// GENERALIZED: [[META38]] = !{}
130+
// GENERALIZED: [[PROF39]] = !{!"branch_weights", i32 1048575, i32 1}
131+
// GENERALIZED: [[DBG40]] = !DILocation(line: 54, column: 1, scope: [[DBG25]])
126132
//.

0 commit comments

Comments
 (0)