mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-08 16:31:55 +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);
|
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
|
#ifndef NDEBUG
|
||||||
void CodeGenProcModel::dump() const {
|
void CodeGenProcModel::dump() const {
|
||||||
dbgs() << Index << ": " << ModelName << " "
|
dbgs() << Index << ": " << ModelName << " "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user