Index: lib/Sema/SemaChecking.cpp =================================================================== --- lib/Sema/SemaChecking.cpp +++ lib/Sema/SemaChecking.cpp @@ -6000,6 +6000,7 @@ while (const TypedefType *UserTy = TyTy->getAs()) { StringRef Name = UserTy->getDecl()->getName(); QualType CastTy = llvm::StringSwitch(Name) + .Case("CFIndex", Context.LongTy) .Case("NSInteger", Context.LongTy) .Case("NSUInteger", Context.UnsignedLongTy) .Case("SInt32", Context.IntTy) Index: test/FixIt/fixit-format-darwin.m =================================================================== --- test/FixIt/fixit-format-darwin.m +++ test/FixIt/fixit-format-darwin.m @@ -8,12 +8,15 @@ int printf(const char * restrict, ...); #if __LP64__ +typedef long CFIndex; typedef long NSInteger; typedef unsigned long NSUInteger; #else +typedef int CFIndex; typedef int NSInteger; typedef unsigned int NSUInteger; #endif +CFIndex getCFIndex(); NSInteger getNSInteger(); NSUInteger getNSUInteger(); @@ -74,3 +77,10 @@ Outer2("test 9: %s %s", getNSInteger(), getNSInteger()); // CHECK: Outer2("test 9: %ld %ld", (long)getNSInteger(), (long)getNSInteger()); } + +void testCFIndex() { + printf("test 10: %s", getCFIndex()); + // CHECK: printf("test 10: %ld", (long)getCFIndex()); + printf("test 11: %s %s", getCFIndex(), getCFIndex()); + // CHECK: printf("test 11: %ld %ld", (long)getCFIndex(), (long)getCFIndex()); +}