Just two suggestions to help in adding UTF16 support for CFString / NSString.
I think llvm::Constant *GetAddrOfConstantCFString can be changed to take s StringLiteral as argument instead of std::string.
So, the UTF16 promotion can be implemented here and works work both __builtin_cfstring and objc literal strings.
The other suggestion it about the containsNonAscii() method. I think it should be containsNonAsciiOrNull(), as GCC promote CF / Obj-C strings to UTF16 for ascii string that contains a NULL character too.
cfutf.diff (3.28 KB)