RegAllocGreedy: Allow target to specify register class ordering.
[oota-llvm.git] / utils / TableGen / CodeGenRegisters.cpp
index 68c27167610d0d2d6de8c2d97cc5147c5cc8bee4..7179611f01274dfbb3b2e9fc34a471fb70be6167 100644 (file)
@@ -711,6 +711,10 @@ CodeGenRegisterClass::CodeGenRegisterClass(CodeGenRegBank &RegBank, Record *R)
   CopyCost = R->getValueAsInt("CopyCost");
   Allocatable = R->getValueAsBit("isAllocatable");
   AltOrderSelect = R->getValueAsString("AltOrderSelect");
+  int AllocationPriority = R->getValueAsInt("AllocationPriority");
+  if (AllocationPriority < 0 || AllocationPriority > 63)
+    PrintFatalError(R->getLoc(), "AllocationPriority out of range [0,63]");
+  this->AllocationPriority = AllocationPriority;
 }
 
 // Create an inferred register class that was missing from the .td files.