Skip to content

Commit 35338df

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
1 parent c1ba3a6 commit 35338df

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
@@ -343,6 +343,8 @@ CODEGENOPT(BoundsSafetyUniqueTraps, 1, 0, Benign) ///< When true, merging of
343343
/// -fbounds-safety trap
344344
/// instructions will be
345345
/// prevented.
346+
347+
ENUM_CODEGENOPT(BoundsSafetyDebugTrapReasons, SanitizeDebugTrapReasonKind, 2, SanitizeDebugTrapReasonKind::Detailed, Benign) ///< Control how "trap reasons" are emitted in debug info
346348
/* TO_UPSTREAM(BoundsSafety) OFF*/
347349

348350
/// 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
@@ -2060,6 +2060,20 @@ defm bounds_safety_legacy_unique_traps : BoolOptionWithoutMarshalling<"f", "uniq
20602060
NegFlag<SetFalse, [], [ClangOption],
20612061
"legacy alias for -fno-bounds-safety-unique-traps">>;
20622062

2063+
def fbounds_safety_debug_trap_reasons_EQ
2064+
: Joined<["-"], "fbounds-safety-debug-trap-reasons=">, Group<f_Group>,
2065+
Visibility<[ClangOption, CC1Option]>,
2066+
HelpText<"Set how trap reasons are emitted. "
2067+
"`none` - Not emitted. This gives the smallest debug info; "
2068+
"`basic` - Emit a fixed trap message per check type. This increases the "
2069+
"debug info size but not as much as `detailed`; "
2070+
"`detailed` - Emit a more detailed trap message. This increases the "
2071+
"debug info size the most. Default is `detailed`.">,
2072+
Values<"none,basic,detailed">,
2073+
NormalizedValuesScope<"CodeGenOptions::SanitizeDebugTrapReasonKind">,
2074+
NormalizedValues<["None", "Basic", "Detailed"]>,
2075+
MarshallingInfoEnum<CodeGenOpts<"BoundsSafetyDebugTrapReasons">, "Detailed">;
2076+
20632077
// TO_UPSTREAM(BoundsSafety) OFF
20642078

20652079
defm lifetime_safety : BoolFOption<

clang/lib/CodeGen/CGExpr.cpp

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

124124
void CodeGenFunction::EmitBoundsSafetyBoundsCheck(
125125
llvm::Type *ElemTy, llvm::Value *Ptr, llvm::Value *Upper,
126-
llvm::Value *Lower, bool AcceptNullPtr,
127-
BoundsSafetyTrapCtx::Kind TrapCtx) {
126+
llvm::Value *Lower, bool AcceptNullPtr, BoundsSafetyTrapCtx::Kind TrapCtx,
127+
PartialDiagnostic *PD) {
128128
if (!Upper && !Lower)
129129
return;
130130
assert(TrapCtx != BoundsSafetyTrapCtx::UNKNOWN);
@@ -159,16 +159,30 @@ void CodeGenFunction::EmitBoundsSafetyBoundsCheck(
159159
BoundsSafetyOptRemarkScope Scope(this, BNS_OR_PTR_GT_UPPER_BOUND);
160160
llvm::Value *OnePastTheEndPtr =
161161
Builder.CreateGEP(ElemTy, Ptr, llvm::ConstantInt::get(SizeTy, 1));
162+
163+
TrapReason OverflowTR;
164+
TrapReason UpperBoundTR;
165+
if (PD) {
166+
CGM.BuildTrapReason(diag::trap_bs_upper_lower_overflow_bound,
167+
UpperBoundTR)
168+
<< *PD << diag::BoundsSafetyPtrCheckKind::Upper;
169+
CGM.BuildTrapReason(diag::trap_bs_upper_lower_overflow_bound,
170+
OverflowTR)
171+
<< *PD << diag::BoundsSafetyPtrCheckKind::Overflow;
172+
}
173+
162174
// Emitting the upper bound check first since it's more
163175
// optimization-friendly. This is because the upper bound calculation (ptr
164176
// + size) is often marked 'inbounds' if 'ptr' is '__counted_by' or an
165177
// array decay of a sized array. This allows ConstraintElimination to use
166178
// this information to infer subsequent pointer arithmetic (ptr + i; where
167179
// 'i <= size') doesn't wrap.
168180
EmitBoundsSafetyTrapCheck(Builder.CreateICmpULE(OnePastTheEndPtr, Upper),
169-
BNS_TRAP_PTR_GT_UPPER_BOUND, TrapCtx);
181+
BNS_TRAP_PTR_GT_UPPER_BOUND, TrapCtx,
182+
PD ? &UpperBoundTR : nullptr);
170183
EmitBoundsSafetyTrapCheck(Builder.CreateICmpULE(Ptr, OnePastTheEndPtr),
171-
BNS_TRAP_PTR_GT_UPPER_BOUND, TrapCtx);
184+
BNS_TRAP_PTR_GT_UPPER_BOUND, TrapCtx,
185+
PD ? &OverflowTR : nullptr);
172186
} else {
173187
// Path where the size of the access is assumed to be 1 byte. This is used
174188
// for
@@ -190,14 +204,31 @@ void CodeGenFunction::EmitBoundsSafetyBoundsCheck(
190204
//
191205
BoundsSafetyOptRemarkScope Scope(this, BNS_OR_PTR_GE_UPPER_BOUND);
192206
llvm::Value *Check = Builder.CreateICmpULT(Ptr, Upper);
193-
EmitBoundsSafetyTrapCheck(Check, BNS_TRAP_PTR_GE_UPPER_BOUND, TrapCtx);
207+
208+
TrapReason UpperTR;
209+
if (PD) {
210+
CGM.BuildTrapReason(diag::trap_bs_upper_lower_overflow_bound, UpperTR)
211+
<< *PD << diag::BoundsSafetyPtrCheckKind::Upper;
212+
}
213+
214+
EmitBoundsSafetyTrapCheck(Check, BNS_TRAP_PTR_GE_UPPER_BOUND, TrapCtx,
215+
PD ? &UpperTR : nullptr);
194216
}
195217
}
196218

197219
if (Lower) {
198220
BoundsSafetyOptRemarkScope Scope(this, BNS_OR_PTR_LT_LOWER_BOUND);
199221
llvm::Value *Check = Builder.CreateICmpUGE(Ptr, Lower);
200-
EmitBoundsSafetyTrapCheck(Check, BNS_TRAP_PTR_LT_LOWER_BOUND, TrapCtx);
222+
223+
TrapReason LowerBoundTR;
224+
if (PD) {
225+
CGM.BuildTrapReason(diag::trap_bs_upper_lower_overflow_bound,
226+
LowerBoundTR)
227+
<< *PD << diag::BoundsSafetyPtrCheckKind::Lower;
228+
}
229+
230+
EmitBoundsSafetyTrapCheck(Check, BNS_TRAP_PTR_LT_LOWER_BOUND, TrapCtx,
231+
PD ? &LowerBoundTR : nullptr);
201232
}
202233
if (NullCheckBranch)
203234
NullCheckBranch->setSuccessor(1, Builder.GetInsertBlock());
@@ -4869,9 +4900,15 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
48694900
llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation();
48704901
llvm::StringRef TrapMessage;
48714902
llvm::StringRef TrapCategory;
4872-
auto DebugTrapReasonKind = CGM.getCodeGenOpts().getSanitizeDebugTrapReasons();
4873-
48744903
/* TO_UPSTREAM(BoundsSafety) ON*/
4904+
CodeGenOptions::SanitizeDebugTrapReasonKind DebugTrapReasonKind;
4905+
if (CheckHandlerID == SanitizerHandler::BoundsSafety) {
4906+
DebugTrapReasonKind =
4907+
CGM.getCodeGenOpts().getBoundsSafetyDebugTrapReasons();
4908+
} else {
4909+
DebugTrapReasonKind = CGM.getCodeGenOpts().getSanitizeDebugTrapReasons();
4910+
}
4911+
48754912
if (TR && !TR->isEmpty() &&
48764913
(DebugTrapReasonKind ==
48774914
CodeGenOptions::SanitizeDebugTrapReasonKind::Detailed ||
@@ -4885,9 +4922,8 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
48854922
}
48864923

48874924
if (getDebugInfo() && !(TrapMessage.empty() && TrapCategory.empty()) &&
4888-
(DebugTrapReasonKind !=
4889-
CodeGenOptions::SanitizeDebugTrapReasonKind::None ||
4890-
CheckHandlerID == SanitizerHandler::BoundsSafety) &&
4925+
DebugTrapReasonKind !=
4926+
CodeGenOptions::SanitizeDebugTrapReasonKind::None &&
48914927
TrapLocation) {
48924928
TrapLocation = getDebugInfo()->CreateTrapFailureMessageFor(
48934929
TrapLocation, TrapCategory, TrapMessage);
@@ -4983,10 +5019,11 @@ void CodeGenFunction::EmitBoundsSafetyTrapCheck(
49835019
auto OptRemark = GetBoundsSafetyOptRemarkForTrap(kind);
49845020
assert(BoundsSafetyOptRemarkScope::InScope(this, OptRemark));
49855021

4986-
// Fallback: If a TrapReason object isn't provided use the legacy approach
4987-
// for constructing
5022+
// Fallback: If a TrapReason object isn't provided or we are asked to provide
5023+
// a "basic" description.
49885024
TrapReason TempTR;
4989-
if (!TR) {
5025+
if (!TR || CGM.getCodeGenOpts().getBoundsSafetyDebugTrapReasons() ==
5026+
CodeGenOptions::SanitizeDebugTrapReasonKind::Basic) {
49905027
CGM.BuildTrapReason(diag::trap_bs_fallback, TempTR)
49915028
<< GetBoundsSafetyTrapMessageSuffix(kind, TrapCtx);
49925029
}
@@ -4996,7 +5033,8 @@ void CodeGenFunction::EmitBoundsSafetyTrapCheck(
49965033
// caches basic blocks that contain instructions that need annotating.
49975034
EmitTrapCheck(Checked, SanitizerHandler::BoundsSafety,
49985035
/*NoMerge=*/CGM.getCodeGenOpts().BoundsSafetyUniqueTraps,
4999-
TR ? TR : &TempTR, GetBoundsSafetyOptRemarkString(OptRemark));
5036+
TempTR.isEmpty() ? TR : &TempTR,
5037+
GetBoundsSafetyOptRemarkString(OptRemark));
50005038
}
50015039

50025040
llvm::CallInst *CodeGenFunction::EmitTrapCall(llvm::Intrinsic::ID IntrID) {
@@ -5331,9 +5369,11 @@ CodeGenFunction::EmitWidePtrArraySubscriptExpr(const ArraySubscriptExpr *E,
53315369
}
53325370
assert(!!Upper && !!Lower);
53335371
llvm::Type *ElemTy = ConvertTypeForMem(E->getType());
5372+
auto PD = CGM.BuildPartialTrapReason();
5373+
PD << diag::BoundsCheckContextKind::Indexing << E;
53345374
EmitBoundsSafetyBoundsCheck(ElemTy, Addr.getBasePointer(), Upper, Lower,
5335-
/*AcceptNullPtr=*/false,
5336-
/*TrapCtx=*/BoundsSafetyTrapCtx::DEREF);
5375+
/*AcceptNullPtr=*/false,
5376+
/*TrapCtx=*/BoundsSafetyTrapCtx::DEREF, &PD);
53375377
}
53385378
return MakeAddrLValue(Addr, E->getType(), BaseInfo, TBAAInfo);
53395379
}

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2977,7 +2977,8 @@ class CodeGenFunction : public CodeGenTypeCache {
29772977
void EmitBoundsSafetyBoundsCheck(
29782978
llvm::Type *ElemTy, llvm::Value *Ptr, llvm::Value *Upper,
29792979
llvm::Value *Lower, bool AcceptNullPt = false,
2980-
BoundsSafetyTrapCtx::Kind TrapCtx = BoundsSafetyTrapCtx::UNKNOWN);
2980+
BoundsSafetyTrapCtx::Kind TrapCtx = BoundsSafetyTrapCtx::UNKNOWN,
2981+
PartialDiagnostic *PD = nullptr);
29812982
void EmitBoundsSafetyRangeCheck(
29822983
llvm::Value *LowerBound, llvm::Value *LowerAccess,
29832984
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
@@ -1841,6 +1841,15 @@ class CodeGenModule : public CodeGenTypeCache {
18411841
return TrapReasonBuilder(&getDiags(), DiagID, TR);
18421842
}
18431843

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

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7076,6 +7076,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &Job,
70767076
CmdArgs.push_back("-fbounds-safety-unique-traps");
70777077
}
70787078
}
7079+
7080+
Args.AddLastArg(CmdArgs, options::OPT_fbounds_safety_debug_trap_reasons_EQ);
70797081
/* TO_UPSTREAM(BoundsSafety) OFF*/
70807082

70817083
// 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)