I wonder whether it makes sense to restrict this to 64-bit MSVC platforms,
since it's not really a problem elsewhere (other platforms have a sane `NULL`)
and it presumably generates marginally worse code. Plus if we start doing this
on, say, Mac OS, it'll make it harder for people to spot they have a bug until
they port to another system.
================
Comment at: lib/CodeGen/CGCall.cpp:2721
@@ +2720,3 @@
+ Expr::NPC_ValueDependentIsNotNull)) {
+ return getContext().getIntPtrType();
+ }
----------------
Is there any way we can check that the current target permits this? (That is,
that widening an integer argument to pointer width will never change the
calling convention.)
================
Comment at: lib/CodeGen/CGCall.cpp:3024
@@ +3023,3 @@
+ V->getType()->isIntegerTy())
+ V = Builder.CreateZExtOrTrunc(V, ArgInfo.getCoerceToType());
+
----------------
Could just `CreateZExt` here. Presumably we should never coerce to a narrower
type?
http://reviews.llvm.org/D5480
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits