Skip to content

Commit c1b8a1a

Browse files
slavapestovtkremenek
authored andcommitted
IRGen: Fix Clang type conversion to map Swift.Bool to _Bool instead of signed char (#2737)
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 8946fa3 commit c1b8a1a

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
@@ -742,7 +742,9 @@ clang::CanQualType ClangTypeConverter::convert(IRGenModule &IGM, CanType type) {
742742
// FIXME: Handle _Bool and DarwinBoolean.
743743
auto &ctx = IGM.getClangASTContext();
744744
auto &TI = ctx.getTargetInfo();
745-
if (TI.useSignedCharForObjCBool()) {
745+
// FIXME: Figure out why useSignedCharForObjCBool() returns
746+
// 'true' on Linux
747+
if (IGM.ObjCInterop && TI.useSignedCharForObjCBool()) {
746748
return ctx.SignedCharTy;
747749
}
748750
}

0 commit comments

Comments
 (0)