[Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & x86-64 Backend
[oota-llvm.git] / lib / CodeGen / StackMaps.cpp
index d3791c3feb5bd54d0db71ab01f62119912324b7b..aab8d5221444360e548ffc5093f5473a6888b4b8 100644 (file)
@@ -286,6 +286,18 @@ void StackMaps::recordPatchPoint(const MachineInstr &MI) {
   }
 #endif
 }
+void StackMaps::recordStatepoint(const MachineInstr &MI) {
+  assert(MI.getOpcode() == TargetOpcode::STATEPOINT &&
+         "expected statepoint");
+
+  StatepointOpers opers(&MI);
+  // Record all the deopt and gc operands (they're contiguous and run from the
+  // initial index to the end of the operand list)
+  const unsigned StartIdx = opers.getVarIdx();
+  recordStackMapOpers(MI, 0xABCDEF00,
+                      MI.operands_begin() + StartIdx, MI.operands_end(),
+                      false);
+}
 
 /// Emit the stackmap header.
 ///