mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
tblgen: use an early return to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171954 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
13f8cf55d4
commit
699b870556
@ -2368,24 +2368,24 @@ bool TGParser::ResolveMulticlassDef(MultiClass &MC,
|
||||
// Don't create a top level definition for defm inside multiclasses,
|
||||
// instead, only update the prototypes and bind the template args
|
||||
// with the new created definition.
|
||||
if (CurMultiClass) {
|
||||
for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size();
|
||||
i != e; ++i)
|
||||
if (CurMultiClass->DefPrototypes[i]->getNameInit()
|
||||
== CurRec->getNameInit())
|
||||
return Error(DefmPrefixLoc, "defm '" + CurRec->getNameInitAsString() +
|
||||
"' already defined in this multiclass!");
|
||||
CurMultiClass->DefPrototypes.push_back(CurRec);
|
||||
if (!CurMultiClass)
|
||||
return false;
|
||||
for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size();
|
||||
i != e; ++i)
|
||||
if (CurMultiClass->DefPrototypes[i]->getNameInit()
|
||||
== CurRec->getNameInit())
|
||||
return Error(DefmPrefixLoc, "defm '" + CurRec->getNameInitAsString() +
|
||||
"' already defined in this multiclass!");
|
||||
CurMultiClass->DefPrototypes.push_back(CurRec);
|
||||
|
||||
// Copy the template arguments for the multiclass into the new def.
|
||||
const std::vector<Init *> &TA =
|
||||
CurMultiClass->Rec.getTemplateArgs();
|
||||
// Copy the template arguments for the multiclass into the new def.
|
||||
const std::vector<Init *> &TA =
|
||||
CurMultiClass->Rec.getTemplateArgs();
|
||||
|
||||
for (unsigned i = 0, e = TA.size(); i != e; ++i) {
|
||||
const RecordVal *RV = CurMultiClass->Rec.getValue(TA[i]);
|
||||
assert(RV && "Template arg doesn't exist?");
|
||||
CurRec->addValue(*RV);
|
||||
}
|
||||
for (unsigned i = 0, e = TA.size(); i != e; ++i) {
|
||||
const RecordVal *RV = CurMultiClass->Rec.getValue(TA[i]);
|
||||
assert(RV && "Template arg doesn't exist?");
|
||||
CurRec->addValue(*RV);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user