[PATCH] D34377: Support MS builtins using 'long' on Darwin/LP64
Reid Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 20 09:58:43 PDT 2017
rnk added inline comments.
Comment at: include/clang/Basic/Builtins.def:55
// W -> int64_t
+// l -> 'int' if builtin is a MS extensions and the target is Darwin/LP64.
+// Defaults to 'L' otherwise.
> Why not just LP64? Seems arbitrary to make this Darwin sensitive.
Every existing prefix is upper case. Do you think it makes it more readable to follow the pattern? Maybe it isn't worth it.
Comment at: lib/AST/ASTContext.cpp:8551
> I agree with @majnemer. Why not base this on the Int64Type?
I'd suggest this code:
IsSpecialLong = true;
// Use "long" if is 32 bits. This prefix is used by intrinsics that need 32-bit types on LP64 platforms, but need to use "long" in the prototype on LLP64 platforms like Win64.
if (Context.getTargetInfo().getLongWidth() == 32)
HowLong = 1;
More information about the cfe-commits