File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ class OwnedString {
52
52
void initialize (const char * Data, size_t Length, StringOwnership Ownership) {
53
53
this ->Length = Length;
54
54
this ->Ownership = Ownership;
55
- assert (Length >= 0 && " expected length to be non-negative" );
56
55
if (Ownership == StringOwnership::Copied && Data) {
57
56
char *substring = static_cast <char *>(malloc (Length + 1 ));
58
57
assert (substring && " expected successful malloc of copy" );
Original file line number Diff line number Diff line change @@ -391,9 +391,13 @@ class JSONFixitWriter
391
391
// This is a separate function so that it shows up in stack traces.
392
392
LLVM_ATTRIBUTE_NOINLINE
393
393
static void debugFailWithAssertion () {
394
- // This assertion should always fail, per the user's request, and should
395
- // not be converted to llvm_unreachable.
396
- assert (0 && " This is an assertion!" );
394
+ // Per the user's request, this assertion should always fail in
395
+ // builds with assertions enabled.
396
+
397
+ // This should not be converted to llvm_unreachable, as those are
398
+ // treated as optimization hints in builds where they turn into
399
+ // __builtin_unreachable().
400
+ assert ((0 ) && " This is an assertion!" );
397
401
}
398
402
399
403
// This is a separate function so that it shows up in stack traces.
Original file line number Diff line number Diff line change @@ -7276,7 +7276,7 @@ bool FailureDiagnosis::visitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
7276
7276
case CC_SelfMismatch: // Self argument mismatches.
7277
7277
case CC_ArgumentNearMismatch: // Argument list mismatch.
7278
7278
case CC_ArgumentMismatch: // Argument list mismatch.
7279
- assert ( 0 && " These aren't produced by filterContextualMemberList" );
7279
+ llvm_unreachable ( " These aren't produced by filterContextualMemberList" );
7280
7280
return false ;
7281
7281
7282
7282
case CC_ExactMatch: { // This is a perfect match for the arguments.
Original file line number Diff line number Diff line change @@ -750,7 +750,7 @@ namespace {
750
750
break ;
751
751
case SpaceKind::Disjunct: {
752
752
if (forDisplay) {
753
- assert ( false && " Attempted to display disjunct to user!" );
753
+ llvm_unreachable ( " Attempted to display disjunct to user!" );
754
754
} else {
755
755
buffer << " DISJOIN(" ;
756
756
for (auto &sp : Spaces) {
You can’t perform that action at this time.
0 commit comments