Skip to content

Commit 6b236db

Browse files
committed
[BoundsSafety] Move traps reasons for indexing to new trap reasons infrastructure
This patch moves generation of the trap reason strings for indexing into pointers into the new trap reason infrastructure. We will need to move many other trap reasons over to the new infrastructure but this is the first we are moving over. Previously array indexing emitted these very unspecifc trap reason messages: - `Dereferencing above bounds` - `Deferencing below bounds` Now we emit trap reasons that look like - `indexing above upper bound in '<expr>'` - `indexing below lower bound in '<expr>'` - `indexing overflows address space in '<expr>'` where `<expr>` is the ArraySubscriptExpr printed as a string (see test cases for example). There are several improvements here: 1. We say indexing rather than dereferencing which is more specific. 2. We emit a specific trap reason for address space overflow. Previously there was no distinction between the upper bound trap and the address space overflow trap. 3. We emit the textual representation of the ArraySubscriptExpr that triggered the bounds check failed. This makes the message very specific. This new approach to emitting trap reasons will likely increase the size of debug info. To give users control a new flag `-fbounds-safety-debug-trap-trap-reasons` has been added which is analogous to `-fsanitize-debug-trap-reasons` for UBSan. The flag takes three values: * `none` - Dont' emit any trap reasons * `detailed` - Emit the new more detailed trap reasons (the default) * `basic` - Emit the less descriptive trap reasons using the legacy infrastructure. While working on this it became clear that emission of trap diagnostics is more complicated than for UBSan become some of the context for where we are emitting the trap exists in a different stackframe than the location where we can actually emit the trap diagnostic. In `EmitWidePtrArraySubscriptExpr` we don't know if we are emitting a lower/upper bound/address space check. In `EmitBoundsSafetyBoundsCheck` we don't know we are emitting a check for an ArraySubscriptExpr so there isn't a function where we can emit the trap diagnostic that has all the necessary information. The solution used in this patch is to re-use the `PartialDiagnostic` class which essentially lets us partially construct a diagnostic in one function and then pass it along to another function to the actual where the trap diagnostic can be fully constructed. Note in this implementation the "detailed" trap reason is always constructed even if it later gets thrown away. There are several reasons for doing this: * For clang's diagnostics normally we typically don't write guards around them to check they are enabled (e.g. the warning might be actually disabled). * While technically we could write guards around all the code that builds the TrapReason objects this will become repetitive very quickly. It's cleaner to just put the guard in this function. * I'm also planning to use these TrapReason objects for the upcoming soft trap mode and I didn't want to put guards around their creation until I've figured out exactly how this is going to be implemented. * This is also how its implemented for UBSan's trapping diagnostics right now. This is not a particularly strong argument because I'm the one who implemented that but at least upstream didn't object to me doing it this way. rdar://158623471 (cherry picked from commit a4898c2)
1 parent 2405d94 commit 6b236db

File tree

16 files changed

+309
-44
lines changed

16 files changed

+309
-44
lines changed

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ CODEGENOPT(BoundsSafetyUniqueTraps, 1, 0, Benign) ///< When true, merging of
337337
/// -fbounds-safety trap
338338
/// instructions will be
339339
/// prevented.
340+
341+
ENUM_CODEGENOPT(BoundsSafetyDebugTrapReasons, SanitizeDebugTrapReasonKind, 2, SanitizeDebugTrapReasonKind::Detailed, Benign) ///< Control how "trap reasons" are emitted in debug info
340342
/* TO_UPSTREAM(BoundsSafety) OFF*/
341343

342344
/// Treat loops as finite: language, always, never.

clang/include/clang/Basic/DiagnosticBoundsSafetyTrapKinds.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,18 @@ let CategoryName = "Bounds check failed" in {
1515
// trap reason strings.
1616
def trap_bs_fallback : Trap<"%0">;
1717

18+
// TODO: Split these up once we know what the diagnostics strings needs to be.
19+
// Ideally we want to be able to generate trap codes and opt-remark strings
20+
// from these definitions too so we'll need to split them up when we do that.
21+
def trap_bs_upper_lower_overflow_bound : Trap<
22+
"%enum_select<BoundsCheckContextKind>{"
23+
"%Indexing{indexing}|"
24+
"%TODO{TODO}"
25+
"}0 %enum_select<BoundsSafetyPtrCheckKind>{"
26+
"%Upper{above upper bound}|"
27+
"%Overflow{overflows address space}|"
28+
"%Lower{below lower bound"
29+
"}}2 in %1">;
30+
1831
}
1932
}

clang/include/clang/Driver/Options.td

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,20 @@ defm bounds_safety_legacy_unique_traps : BoolOptionWithoutMarshalling<"f", "uniq
20452045
NegFlag<SetFalse, [], [ClangOption],
20462046
"legacy alias for -fno-bounds-safety-unique-traps">>;
20472047

2048+
def fbounds_safety_debug_trap_reasons_EQ
2049+
: Joined<["-"], "fbounds-safety-debug-trap-reasons=">, Group<f_Group>,
2050+
Visibility<[ClangOption, CC1Option]>,
2051+
HelpText<"Set how trap reasons are emitted. "
2052+
"`none` - Not emitted. This gives the smallest debug info; "
2053+
"`basic` - Emit a fixed trap message per check type. This increases the "
2054+
"debug info size but not as much as `detailed`; "
2055+
"`detailed` - Emit a more detailed trap message. This increases the "
2056+
"debug info size the most. Default is `detailed`.">,
2057+
Values<"none,basic,detailed">,
2058+
NormalizedValuesScope<"CodeGenOptions::SanitizeDebugTrapReasonKind">,
2059+
NormalizedValues<["None", "Basic", "Detailed"]>,
2060+
MarshallingInfoEnum<CodeGenOpts<"BoundsSafetyDebugTrapReasons">, "Detailed">;
2061+
20482062
// TO_UPSTREAM(BoundsSafety) OFF
20492063

20502064
defm lifetime_safety : BoolFOption<

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ void CodeGenFunction::EmitPtrCastLECheck(llvm::Value *LHS, llvm::Value *RHS,
121121

122122
void CodeGenFunction::EmitBoundsSafetyBoundsCheck(
123123
llvm::Type *ElemTy, llvm::Value *Ptr, llvm::Value *Upper,
124-
llvm::Value *Lower, bool AcceptNullPtr,
125-
BoundsSafetyTrapCtx::Kind TrapCtx) {
124+
llvm::Value *Lower, bool AcceptNullPtr, BoundsSafetyTrapCtx::Kind TrapCtx,
125+
PartialDiagnostic *PD) {
126126
if (!Upper && !Lower)
127127
return;
128128
assert(TrapCtx != BoundsSafetyTrapCtx::UNKNOWN);
@@ -157,16 +157,30 @@ void CodeGenFunction::EmitBoundsSafetyBoundsCheck(
157157
BoundsSafetyOptRemarkScope Scope(this, BNS_OR_PTR_GT_UPPER_BOUND);
158158
llvm::Value *OnePastTheEndPtr =
159159
Builder.CreateGEP(ElemTy, Ptr, llvm::ConstantInt::get(SizeTy, 1));
160+
161+
TrapReason OverflowTR;
162+
TrapReason UpperBoundTR;
163+
if (PD) {
164+
CGM.BuildTrapReason(diag::trap_bs_upper_lower_overflow_bound,
165+
UpperBoundTR)
166+
<< *PD << diag::BoundsSafetyPtrCheckKind::Upper;
167+
CGM.BuildTrapReason(diag::trap_bs_upper_lower_overflow_bound,
168+
OverflowTR)
169+
<< *PD << diag::BoundsSafetyPtrCheckKind::Overflow;
170+
}
171+
160172
// Emitting the upper bound check first since it's more
161173
// optimization-friendly. This is because the upper bound calculation (ptr
162174
// + size) is often marked 'inbounds' if 'ptr' is '__counted_by' or an
163175
// array decay of a sized array. This allows ConstraintElimination to use
164176
// this information to infer subsequent pointer arithmetic (ptr + i; where
165177
// 'i <= size') doesn't wrap.
166178
EmitBoundsSafetyTrapCheck(Builder.CreateICmpULE(OnePastTheEndPtr, Upper),
167-
BNS_TRAP_PTR_GT_UPPER_BOUND, TrapCtx);
179+
BNS_TRAP_PTR_GT_UPPER_BOUND, TrapCtx,
180+
PD ? &UpperBoundTR : nullptr);
168181
EmitBoundsSafetyTrapCheck(Builder.CreateICmpULE(Ptr, OnePastTheEndPtr),
169-
BNS_TRAP_PTR_GT_UPPER_BOUND, TrapCtx);
182+
BNS_TRAP_PTR_GT_UPPER_BOUND, TrapCtx,
183+
PD ? &OverflowTR : nullptr);
170184
} else {
171185
// Path where the size of the access is assumed to be 1 byte. This is used
172186
// for
@@ -188,14 +202,31 @@ void CodeGenFunction::EmitBoundsSafetyBoundsCheck(
188202
//
189203
BoundsSafetyOptRemarkScope Scope(this, BNS_OR_PTR_GE_UPPER_BOUND);
190204
llvm::Value *Check = Builder.CreateICmpULT(Ptr, Upper);
191-
EmitBoundsSafetyTrapCheck(Check, BNS_TRAP_PTR_GE_UPPER_BOUND, TrapCtx);
205+
206+
TrapReason UpperTR;
207+
if (PD) {
208+
CGM.BuildTrapReason(diag::trap_bs_upper_lower_overflow_bound, UpperTR)
209+
<< *PD << diag::BoundsSafetyPtrCheckKind::Upper;
210+
}
211+
212+
EmitBoundsSafetyTrapCheck(Check, BNS_TRAP_PTR_GE_UPPER_BOUND, TrapCtx,
213+
PD ? &UpperTR : nullptr);
192214
}
193215
}
194216

195217
if (Lower) {
196218
BoundsSafetyOptRemarkScope Scope(this, BNS_OR_PTR_LT_LOWER_BOUND);
197219
llvm::Value *Check = Builder.CreateICmpUGE(Ptr, Lower);
198-
EmitBoundsSafetyTrapCheck(Check, BNS_TRAP_PTR_LT_LOWER_BOUND, TrapCtx);
220+
221+
TrapReason LowerBoundTR;
222+
if (PD) {
223+
CGM.BuildTrapReason(diag::trap_bs_upper_lower_overflow_bound,
224+
LowerBoundTR)
225+
<< *PD << diag::BoundsSafetyPtrCheckKind::Lower;
226+
}
227+
228+
EmitBoundsSafetyTrapCheck(Check, BNS_TRAP_PTR_LT_LOWER_BOUND, TrapCtx,
229+
PD ? &LowerBoundTR : nullptr);
199230
}
200231
if (NullCheckBranch)
201232
NullCheckBranch->setSuccessor(1, Builder.GetInsertBlock());
@@ -4591,9 +4622,15 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
45914622
llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation();
45924623
llvm::StringRef TrapMessage;
45934624
llvm::StringRef TrapCategory;
4594-
auto DebugTrapReasonKind = CGM.getCodeGenOpts().getSanitizeDebugTrapReasons();
4595-
45964625
/* TO_UPSTREAM(BoundsSafety) ON*/
4626+
CodeGenOptions::SanitizeDebugTrapReasonKind DebugTrapReasonKind;
4627+
if (CheckHandlerID == SanitizerHandler::BoundsSafety) {
4628+
DebugTrapReasonKind =
4629+
CGM.getCodeGenOpts().getBoundsSafetyDebugTrapReasons();
4630+
} else {
4631+
DebugTrapReasonKind = CGM.getCodeGenOpts().getSanitizeDebugTrapReasons();
4632+
}
4633+
45974634
if (TR && !TR->isEmpty() &&
45984635
(DebugTrapReasonKind ==
45994636
CodeGenOptions::SanitizeDebugTrapReasonKind::Detailed ||
@@ -4607,9 +4644,8 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
46074644
}
46084645

46094646
if (getDebugInfo() && !(TrapMessage.empty() && TrapCategory.empty()) &&
4610-
(DebugTrapReasonKind !=
4611-
CodeGenOptions::SanitizeDebugTrapReasonKind::None ||
4612-
CheckHandlerID == SanitizerHandler::BoundsSafety) &&
4647+
DebugTrapReasonKind !=
4648+
CodeGenOptions::SanitizeDebugTrapReasonKind::None &&
46134649
TrapLocation) {
46144650
TrapLocation = getDebugInfo()->CreateTrapFailureMessageFor(
46154651
TrapLocation, TrapCategory, TrapMessage);
@@ -4705,10 +4741,11 @@ void CodeGenFunction::EmitBoundsSafetyTrapCheck(
47054741
auto OptRemark = GetBoundsSafetyOptRemarkForTrap(kind);
47064742
assert(BoundsSafetyOptRemarkScope::InScope(this, OptRemark));
47074743

4708-
// Fallback: If a TrapReason object isn't provided use the legacy approach
4709-
// for constructing
4744+
// Fallback: If a TrapReason object isn't provided or we are asked to provide
4745+
// a "basic" description.
47104746
TrapReason TempTR;
4711-
if (!TR) {
4747+
if (!TR || CGM.getCodeGenOpts().getBoundsSafetyDebugTrapReasons() ==
4748+
CodeGenOptions::SanitizeDebugTrapReasonKind::Basic) {
47124749
CGM.BuildTrapReason(diag::trap_bs_fallback, TempTR)
47134750
<< GetBoundsSafetyTrapMessageSuffix(kind, TrapCtx);
47144751
}
@@ -4718,7 +4755,8 @@ void CodeGenFunction::EmitBoundsSafetyTrapCheck(
47184755
// caches basic blocks that contain instructions that need annotating.
47194756
EmitTrapCheck(Checked, SanitizerHandler::BoundsSafety,
47204757
/*NoMerge=*/CGM.getCodeGenOpts().BoundsSafetyUniqueTraps,
4721-
TR ? TR : &TempTR, GetBoundsSafetyOptRemarkString(OptRemark));
4758+
TempTR.isEmpty() ? TR : &TempTR,
4759+
GetBoundsSafetyOptRemarkString(OptRemark));
47224760
}
47234761

47244762
llvm::CallInst *CodeGenFunction::EmitTrapCall(llvm::Intrinsic::ID IntrID) {
@@ -5065,9 +5103,11 @@ CodeGenFunction::EmitWidePtrArraySubscriptExpr(const ArraySubscriptExpr *E,
50655103
}
50665104
assert(!!Upper && !!Lower);
50675105
llvm::Type *ElemTy = ConvertTypeForMem(E->getType());
5106+
auto PD = CGM.BuildPartialTrapReason();
5107+
PD << diag::BoundsCheckContextKind::Indexing << E;
50685108
EmitBoundsSafetyBoundsCheck(ElemTy, Addr.getBasePointer(), Upper, Lower,
5069-
/*AcceptNullPtr=*/false,
5070-
/*TrapCtx=*/BoundsSafetyTrapCtx::DEREF);
5109+
/*AcceptNullPtr=*/false,
5110+
/*TrapCtx=*/BoundsSafetyTrapCtx::DEREF, &PD);
50715111
}
50725112
return MakeAddrLValue(Addr, E->getType(), BaseInfo, TBAAInfo);
50735113
}

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,8 @@ class CodeGenFunction : public CodeGenTypeCache {
29662966
void EmitBoundsSafetyBoundsCheck(
29672967
llvm::Type *ElemTy, llvm::Value *Ptr, llvm::Value *Upper,
29682968
llvm::Value *Lower, bool AcceptNullPt = false,
2969-
BoundsSafetyTrapCtx::Kind TrapCtx = BoundsSafetyTrapCtx::UNKNOWN);
2969+
BoundsSafetyTrapCtx::Kind TrapCtx = BoundsSafetyTrapCtx::UNKNOWN,
2970+
PartialDiagnostic *PD = nullptr);
29702971
void EmitBoundsSafetyRangeCheck(
29712972
llvm::Value *LowerBound, llvm::Value *LowerAccess,
29722973
llvm::Value *UpperAccess, llvm::Value *UpperBound,

clang/lib/CodeGen/CodeGenModule.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,15 @@ class CodeGenModule : public CodeGenTypeCache {
18391839
return TrapReasonBuilder(&getDiags(), DiagID, TR);
18401840
}
18411841

1842+
/* TO_UPSTREAM(BoundsSafety) ON*/
1843+
PartialDiagnostic BuildPartialTrapReason() {
1844+
// When building trap reasons we sometimes don't know exactly
1845+
// which diagnostic is going to be emitted so we just specify
1846+
// `0` as place holder.
1847+
return PartialDiagnostic(0, getContext().getDiagAllocator());
1848+
}
1849+
/* TO_UPSTREAM(BoundsSafety) OFF*/
1850+
18421851
private:
18431852
bool shouldDropDLLAttribute(const Decl *D, const llvm::GlobalValue *GV) const;
18441853

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7136,6 +7136,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &Job,
71367136
CmdArgs.push_back("-fbounds-safety-unique-traps");
71377137
}
71387138
}
7139+
7140+
Args.AddLastArg(CmdArgs, options::OPT_fbounds_safety_debug_trap_reasons_EQ);
71397141
/* TO_UPSTREAM(BoundsSafety) OFF*/
71407142

71417143
// Handle -f[no-]wrapv and -f[no-]strict-overflow, which are used by both

clang/test/BoundsSafety-legacy-checks/CodeGen/opt-remarks/ptr-bounds-argc-O0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ int main(int argc, char **argv) {
6363

6464
// IR-DAG: ![[LOC_10_16]] = !DILocation(line: 10, column: 16{{.*}})
6565
// IR-DAG: ![[LT_TRAP_LOC_10_16]] = !DILocation(line: 0, scope: ![[LT_TRAP_INFO_10_16:[0-9]+]], inlinedAt: ![[LOC_10_16]])
66-
// IR-DAG: ![[LT_TRAP_INFO_10_16]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$Dereferencing above bounds"
66+
// IR-DAG: ![[LT_TRAP_INFO_10_16]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$indexing above upper bound in 'array[idx]'"
6767
// IR-DAG: ![[GE_TRAP_LOC_10_16]] = !DILocation(line: 0, scope: ![[GE_TRAP_INFO_10_16:[0-9]+]], inlinedAt: ![[LOC_10_16]])
68-
// IR-DAG: ![[GE_TRAP_INFO_10_16]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$Dereferencing below bounds"
68+
// IR-DAG: ![[GE_TRAP_INFO_10_16]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$indexing below lower bound in 'array[idx]'"
6969
//
7070
// IR-DAG: ![[LOC_16_5]] = !DILocation(line: 16, column: 5
7171
// IR-DAG: ![[TRAP_LOC_16_5]] = !DILocation(line: 0, scope: ![[TRAP_INFO_16_5:[0-9]+]], inlinedAt: ![[LOC_16_5]])

clang/test/BoundsSafety-legacy-checks/CodeGen/opt-remarks/ptr-bounds-const-O0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ int main() {
6363

6464
// IR-DAG: ![[LOC_10_14]] = !DILocation(line: 10, column: 14{{.*}})
6565
// IR-DAG: ![[LT_TRAP_LOC_10_14]] = !DILocation(line: 0, scope: ![[LT_TRAP_INFO_10_14:[0-9]+]], inlinedAt: ![[LOC_10_14]])
66-
// IR-DAG: ![[LT_TRAP_INFO_10_14]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$Dereferencing above bounds"
66+
// IR-DAG: ![[LT_TRAP_INFO_10_14]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$indexing above upper bound in 'array[6]'"
6767
// IR-DAG: ![[GT_TRAP_LOC_10_14]] = !DILocation(line: 0, scope: ![[GT_TRAP_INFO_10_14:[0-9]+]], inlinedAt: ![[LOC_10_14]])
68-
// IR-DAG: ![[GT_TRAP_INFO_10_14]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$Dereferencing below bounds"
68+
// IR-DAG: ![[GT_TRAP_INFO_10_14]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$indexing below lower bound in 'array[6]'"
6969
// IR-DAG: ![[LOC_16_5]] = !DILocation(line: 16, column: 5
7070
// IR-DAG: ![[TRAP_LOC_16_5]] = !DILocation(line: 0, scope: ![[TRAP_INFO_16_5:[0-9]+]], inlinedAt: ![[LOC_16_5]])
7171
// IR-DAG: ![[TRAP_INFO_16_5]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$"

clang/test/BoundsSafety-legacy-checks/CodeGen/trap-reasons/ptr_ge_upper_bound-deref-array_subscript-O0.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11

2-
// RUN: %clang_cc1 -O0 -debug-info-kind=standalone -dwarf-version=5 -fbounds-safety -emit-llvm %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -O0 -debug-info-kind=standalone -dwarf-version=5 \
3+
// RUN: -fbounds-safety -fbounds-safety-debug-trap-reasons=basic \
4+
// RUN: -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,BASIC %s
5+
6+
// RUN: %clang_cc1 -O0 -debug-info-kind=standalone -dwarf-version=5 \
7+
// RUN: -fbounds-safety -fbounds-safety-debug-trap-reasons=detailed \
8+
// RUN: -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,DETAILED %s
39

410
int operation(int index) {
511
int array[] = {0, 1, 2};
@@ -15,5 +21,8 @@ int operation(int index) {
1521
// CHECK-NEXT: call void @llvm.ubsantrap(i8 25) {{.*}}!dbg [[TRAP_LOC:![0-9]+]]
1622

1723
// CHECK-DAG: [[TRAP_LOC]] = !DILocation(line: 0, scope: [[TRAP_SCOPE:![0-9]+]], inlinedAt: [[LOC]])
18-
// CHECK-DAG: [[TRAP_SCOPE]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$Dereferencing above bounds", scope: [[FILE_SCOPE:![0-9]+]], file: [[FILE_SCOPE]], type: {{![0-9]+}}, flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: {{![0-9]+}}
19-
// CHECK-DAG: [[LOC]] = !DILocation(line: 6, column: 10, scope: {{![0-9]+}})
24+
25+
// BASIC-DAG: [[TRAP_SCOPE]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$Dereferencing above bounds", scope: [[FILE_SCOPE:![0-9]+]], file: [[FILE_SCOPE]], type: {{![0-9]+}}, flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: {{![0-9]+}}
26+
// DETAILED-DAG: [[TRAP_SCOPE]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$indexing above upper bound in 'array[index]'", scope: [[FILE_SCOPE:![0-9]+]], file: [[FILE_SCOPE]], type: {{![0-9]+}}, flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: {{![0-9]+}}
27+
28+
// CHECK-DAG: [[LOC]] = !DILocation(line: 12, column: 10, scope: {{![0-9]+}})

0 commit comments

Comments
 (0)