No longer include IGNode.h in the Sparc global header
[oota-llvm.git] / lib / Target / SparcV9 / SparcV9RegClassInfo.cpp
index c27c28b33f0fbd928d4beab266402e36d5482121..6050cf069d8c7637db7dad10695427b8af6d673f 100644 (file)
@@ -8,6 +8,7 @@
 #include "SparcInternals.h"
 #include "llvm/Type.h"
 #include "../../CodeGen/RegAlloc/RegAllocCommon.h"   // FIXME!
+#include "llvm/CodeGen/IGNode.h"
 
 //-----------------------------------------------------------------------------
 // Int Register Class - method for coloring a node in the interference graph.
@@ -162,6 +163,19 @@ void SparcIntCCRegClass::colorIGNode(IGNode *Node,
 }
 
 
+void SparcFloatCCRegClass::colorIGNode(IGNode *Node,
+                                const std::vector<bool> &IsColorUsedArr) const {
+  for(unsigned c = 0; c != 4; ++c)
+    if (!IsColorUsedArr[c]) { // find unused color
+      Node->setColor(c);   
+      return;
+    }
+  
+  Node->getParentLR()->markForSpill();
+}
+
+
+
 //-----------------------------------------------------------------------------
 // Float Register Class - method for coloring a node in the interference graph.
 //