[llvm-commits] [llvm] r164057 - /llvm/trunk/utils/TableGen/CodeGenSchedule.cpp
Andrew Trick
atrick at apple.com
Mon Sep 17 15:18:43 PDT 2012
Author: atrick
Date: Mon Sep 17 17:18:43 2012
New Revision: 164057
URL: http://llvm.org/viewvc/llvm-project?rev=164057&view=rev
Log:
TableGen subtarget parser: Add getProcResourcesIdx().
Modified:
llvm/trunk/utils/TableGen/CodeGenSchedule.cpp
Modified: llvm/trunk/utils/TableGen/CodeGenSchedule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenSchedule.cpp?rev=164057&r1=164056&r2=164057&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenSchedule.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenSchedule.cpp Mon Sep 17 17:18:43 2012
@@ -1274,6 +1274,16 @@
RADefs.push_back(ProcReadAdvanceDef);
}
+unsigned CodeGenProcModel::getProcResourceIdx(Record *PRDef) const {
+ RecIter PRPos = std::find(ProcResourceDefs.begin(), ProcResourceDefs.end(),
+ PRDef);
+ if (PRPos == ProcResourceDefs.end())
+ throw TGError(PRDef->getLoc(), "ProcResource def is not included in "
+ "the ProcResources list for " + ModelName);
+ // Idx=0 is reserved for invalid.
+ return 1 + PRPos - ProcResourceDefs.begin();
+}
+
#ifndef NDEBUG
void CodeGenProcModel::dump() const {
dbgs() << Index << ": " << ModelName << " "
More information about the llvm-commits
mailing list