[PATCH] CGCall: Factor out the logic mapping call arguments to LLVM IR arguments.

Alexey Samsonov vonosmas at gmail.com
Mon Aug 18 22:59:22 PDT 2014


================
Comment at: lib/CodeGen/CGCall.cpp:1048
@@ +1047,3 @@
+
+class CallArgsToIRArgsMapping {
+  const unsigned InvalidIndex = ~0U;
----------------
Reid Kleckner wrote:
> I think we can sink all of this into CGFunctionInfo once we remove the AAPCS issue.  I pinged James Molloy about this.
I thought that CGFunctionInfo is designed to be as small as possible (all of them are memoized in CodeGenTypes, for instance), and Args->IRArgs mapping in fact describes the "algorithm", not a function definition and would hardly be useful outside if CGCall routines.

================
Comment at: lib/CodeGen/CGCall.cpp:1140
@@ +1139,3 @@
+        // side, so extension should be a non-issue.
+        CGM.getTypes().GetExpandedTypes(ArgType, Types);
+        NumIRArgs = Types.size();
----------------
Reid Kleckner wrote:
> Maybe we can do this once after computing CGFunctionInfo and then store it in CGFunctionInfo?
See comment above. We might, though, have a different cache that would tell the number of IR arguments each QualType will extend to.

http://reviews.llvm.org/D4938






More information about the cfe-commits mailing list