Skip to content

Commit 06b2fce

Browse files
committed
IRGen: Fix Clang type conversion to map Swift.Bool to _Bool instead of signed char
CoreFoundation on Linux expects this. I'm not sure what changed recently to expose this problem -- and I *am* sure that this workaround is not the right way of doing it. However, the public CI on Linux has been broken for a week now because of this, so let's get it passing again so we can investigate what changed in Clang/LLVM here. Fixes <rdar://problem/26444628>.
1 parent ecf94f5 commit 06b2fce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/IRGen/GenClangType.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,9 @@ clang::CanQualType ClangTypeConverter::convert(IRGenModule &IGM, CanType type) {
740740
// FIXME: Handle _Bool and DarwinBoolean.
741741
auto &ctx = IGM.getClangASTContext();
742742
auto &TI = ctx.getTargetInfo();
743-
if (TI.useSignedCharForObjCBool()) {
743+
// FIXME: Figure out why useSignedCharForObjCBool() returns
744+
// 'true' on Linux
745+
if (IGM.ObjCInterop && TI.useSignedCharForObjCBool()) {
744746
return ctx.SignedCharTy;
745747
}
746748
}

0 commit comments

Comments
 (0)