================
@@ -47,18 +98,51 @@ class CIRGenFunctionInfo final
 
   // This function has to be CamelCase because llvm::FoldingSet requires so.
   // NOLINTNEXTLINE(readability-identifier-naming)
-  static void Profile(llvm::FoldingSetNodeID &id, CanQualType resultType) {
+  static void Profile(llvm::FoldingSetNodeID &id, RequiredArgs required,
+                      CanQualType resultType,
+                      llvm::ArrayRef<CanQualType> argTypes) {
+    id.AddBoolean(required.getOpaqueData());
     resultType.Profile(id);
+    for (const auto &arg : argTypes)
+      arg.Profile(id);
   }
 
-  void Profile(llvm::FoldingSetNodeID &id) { getReturnType().Profile(id); }
+  // NOLINTNEXTLINE(readability-identifier-naming)
+  void Profile(llvm::FoldingSetNodeID &id) {
+    id.AddBoolean(required.getOpaqueData());
+    getReturnType().Profile(id);
+    for (const auto &i : arguments())
+      i.type.Profile(id);
+  }
 
   CanQualType getReturnType() const { return getArgsBuffer()[0].type; }
 
   cir::ABIArgInfo &getReturnInfo() { return getArgsBuffer()[0].info; }
   const cir::ABIArgInfo &getReturnInfo() const {
     return getArgsBuffer()[0].info;
   }
+  using const_arg_iterator = const ArgInfo *;
+  using arg_iterator = ArgInfo *;
+
+  const_arg_iterator arg_begin() const { return getArgsBuffer() + 1; }
+  const_arg_iterator arg_end() const { return getArgsBuffer() + 1 + numArgs; }
+  arg_iterator arg_begin() { return getArgsBuffer() + 1; }
+  arg_iterator arg_end() { return getArgsBuffer() + 1 + numArgs; }
+
+  unsigned arg_size() const { return numArgs; }
+
+  llvm::MutableArrayRef<ArgInfo> arguments() {
----------------
andykaylor wrote:

This doesn't seem like the right name here. It's return info about the 
arguments, not the actual arguments, right? Similarly for the arg_begin and 
arg_end functions.

https://github.com/llvm/llvm-project/pull/136854
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to