[PATCH] D34367: CodeGen: Fix address space of indirect function argument

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 7 12:09:37 PST 2018


rjmccall added inline comments.


================
Comment at: lib/CodeGen/CGCall.cpp:3427
     (void)InitialArgSize;
-    RValue RVArg = Args.back().RV;
-    EmitNonNullArgCheck(RVArg, ArgTypes[Idx], (*Arg)->getExprLoc(), AC,
-                        ParamsToSkip + Idx);
-    // @llvm.objectsize should never have side-effects and shouldn't need
-    // destruction/cleanups, so we can safely "emit" it after its arg,
-    // regardless of right-to-leftness
-    MaybeEmitImplicitObjectSize(Idx, *Arg, RVArg);
+    if (!Args.back().hasLValue()) {
+      RValue RVArg = Args.back().getKnownRValue();
----------------
I think it's okay to do this because of a reasonable assumption that pointer arguments are never emitted as LValues, but you should leave that as a comment.


https://reviews.llvm.org/D34367





More information about the cfe-commits mailing list