Skip to content

Commit f99b53d

Browse files
committed
Remove debug helpers
1 parent bd3d743 commit f99b53d

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

include/swift/Runtime/Debug.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ swift_dynamicCastFailure(const void *sourceType, const char *sourceName,
114114
SWIFT_RUNTIME_EXPORT
115115
void swift_reportError(uint32_t flags, const char *message);
116116

117-
SWIFT_RUNTIME_EXPORT
118-
void swift_assertEqual(int64_t a, int64_t b);
119-
120117
// Halt due to an overflow in swift_retain().
121118
SWIFT_RUNTIME_ATTRIBUTE_NORETURN SWIFT_RUNTIME_ATTRIBUTE_NOINLINE
122119
void swift_abortRetainOverflow();

lib/IRGen/GenStruct.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -417,27 +417,10 @@ namespace {
417417
IGF.IGM.getMetadataLayout(TheStruct.getStructOrBoundGenericStruct());
418418
auto offset = layout.getFieldOffset(
419419
IGF, layout.getDecl()->getStoredProperties()[index]);
420-
421420
llvm::Value *metadata = IGF.emitTypeMetadataRefForLayout(TheStruct);
422-
Address fieldVector = emitAddressOfFieldOffsetVector(IGF, metadata,
423-
TheStruct.getStructOrBoundGenericStruct());
424-
auto oldField = IGF.Builder.CreateConstArrayGEP(fieldVector, index,
425-
IGF.IGM.getPointerSize());
426-
auto oldRet = IGF.Builder.CreateLoad(oldField);
427-
428421
auto field = IGF.emitAddressAtOffset(metadata, offset, IGF.IGM.Int32Ty,
429422
IGF.IGM.getPointerAlignment());
430423
auto newRet = IGF.Builder.CreateLoad(field);
431-
432-
auto assertEqFnTy = llvm::FunctionType::get(IGF.IGM.VoidTy,
433-
{IGF.IGM.Int64Ty, IGF.IGM.Int64Ty},
434-
false);
435-
auto assertEq = IGF.IGM.Module.getOrInsertFunction("swift_assertEqual", assertEqFnTy);
436-
437-
auto a = IGF.Builder.CreateIntCast(newRet, IGF.IGM.Int64Ty, true);
438-
auto b = IGF.Builder.CreateIntCast(oldRet, IGF.IGM.Int64Ty, true);
439-
IGF.Builder.CreateCall(cast<llvm::Constant>(assertEq.getCallee()),
440-
{a, b});
441424
return newRet;
442425
}
443426

stdlib/public/runtime/Errors.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,6 @@ bool swift::_swift_shouldReportFatalErrorsToDebugger() {
343343
return _swift_reportFatalErrorsToDebugger;
344344
}
345345

346-
void swift::swift_assertEqual(int64_t a, int64_t b) {
347-
if (a != b) {
348-
printf("a: %i b: %i\n", a, b);
349-
}
350-
assert(a == b);
351-
}
352-
353346
/// Report a fatal error to system console, stderr, and crash logs.
354347
/// Does not crash by itself.
355348
void swift::swift_reportError(uint32_t flags,

0 commit comments

Comments
 (0)