mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-27 13:30:05 +00:00
TableGen subtarget parser: Add getProcResourcesIdx().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164057 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b024b7014a
commit
bc4ff6e3cf
@ -1274,6 +1274,16 @@ void CodeGenSchedModels::addReadAdvance(Record *ProcReadAdvanceDef,
|
||||
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 << " "
|
||||
|
Loading…
Reference in New Issue
Block a user