Add a variant of AnalyzeCallOperands that can be used by fast isel.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 5 Sep 2008 16:59:26 +0000 (16:59 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 5 Sep 2008 16:59:26 +0000 (16:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55838 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/CallingConvLower.h
lib/CodeGen/SelectionDAG/CallingConvLower.cpp

index 2fda9e5bfb6e01f920e9e6be5ccfac32e3cd63f1..4bad588bc3605742c5b613c4d744aec3732a1e79 100644 (file)
@@ -145,6 +145,12 @@ public:
   /// about the passed values into this state.
   void AnalyzeCallOperands(SDNode *TheCall, CCAssignFn Fn);
 
+  /// AnalyzeCallOperands - Same as above except it takes vectors of types
+  /// and argument flags.
+  void AnalyzeCallOperands(SmallVectorImpl<MVT> ArgVTs,
+                           SmallVectorImpl<ISD::ArgFlagsTy> &Flags,
+                           CCAssignFn Fn);
+
   /// AnalyzeCallResult - Analyze the return values of an ISD::CALL node,
   /// incorporating info about the passed values into this state.
   void AnalyzeCallResult(SDNode *TheCall, CCAssignFn Fn);
index 9d0537e1018e0a70af7a49726417c163ed77c114..4788b15d95947a09c3a7f8303180d140107dd200 100644 (file)
@@ -105,6 +105,23 @@ void CCState::AnalyzeCallOperands(SDNode *TheCall, CCAssignFn Fn) {
   }
 }
 
+/// AnalyzeCallOperands - Same as above except it takes vectors of types
+/// and argument flags.
+void CCState::AnalyzeCallOperands(SmallVectorImpl<MVT> ArgVTs,
+                                  SmallVectorImpl<ISD::ArgFlagsTy> &Flags,
+                                  CCAssignFn Fn) {
+  unsigned NumOps = ArgVTs.size();
+  for (unsigned i = 0; i != NumOps; ++i) {
+    MVT ArgVT = ArgVTs[i];
+    ISD::ArgFlagsTy ArgFlags = Flags[i];
+    if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) {
+      cerr << "Call operand #" << i << " has unhandled type "
+           << ArgVT.getMVTString() << "\n";
+      abort();
+    }
+  }
+}
+
 /// AnalyzeCallResult - Analyze the return values of an ISD::CALL node,
 /// incorporating info about the passed values into this state.
 void CCState::AnalyzeCallResult(SDNode *TheCall, CCAssignFn Fn) {