mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
tblgen: use an early return to reduce indentation.
llvm-svn: 171954
This commit is contained in:
parent
18e176ccaa
commit
54bb0c16da
@ -2368,24 +2368,24 @@ bool TGParser::ResolveMulticlassDef(MultiClass &MC,
|
|||||||
// Don't create a top level definition for defm inside multiclasses,
|
// Don't create a top level definition for defm inside multiclasses,
|
||||||
// instead, only update the prototypes and bind the template args
|
// instead, only update the prototypes and bind the template args
|
||||||
// with the new created definition.
|
// with the new created definition.
|
||||||
if (CurMultiClass) {
|
if (!CurMultiClass)
|
||||||
for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size();
|
return false;
|
||||||
i != e; ++i)
|
for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size();
|
||||||
if (CurMultiClass->DefPrototypes[i]->getNameInit()
|
i != e; ++i)
|
||||||
== CurRec->getNameInit())
|
if (CurMultiClass->DefPrototypes[i]->getNameInit()
|
||||||
return Error(DefmPrefixLoc, "defm '" + CurRec->getNameInitAsString() +
|
== CurRec->getNameInit())
|
||||||
"' already defined in this multiclass!");
|
return Error(DefmPrefixLoc, "defm '" + CurRec->getNameInitAsString() +
|
||||||
CurMultiClass->DefPrototypes.push_back(CurRec);
|
"' already defined in this multiclass!");
|
||||||
|
CurMultiClass->DefPrototypes.push_back(CurRec);
|
||||||
|
|
||||||
// Copy the template arguments for the multiclass into the new def.
|
// Copy the template arguments for the multiclass into the new def.
|
||||||
const std::vector<Init *> &TA =
|
const std::vector<Init *> &TA =
|
||||||
CurMultiClass->Rec.getTemplateArgs();
|
CurMultiClass->Rec.getTemplateArgs();
|
||||||
|
|
||||||
for (unsigned i = 0, e = TA.size(); i != e; ++i) {
|
for (unsigned i = 0, e = TA.size(); i != e; ++i) {
|
||||||
const RecordVal *RV = CurMultiClass->Rec.getValue(TA[i]);
|
const RecordVal *RV = CurMultiClass->Rec.getValue(TA[i]);
|
||||||
assert(RV && "Template arg doesn't exist?");
|
assert(RV && "Template arg doesn't exist?");
|
||||||
CurRec->addValue(*RV);
|
CurRec->addValue(*RV);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user