mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-18 10:24:45 +00:00
[TableGen] Cleanup formatting by moving operators from beginning of line to end of previous line. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236206 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1114,9 +1114,9 @@ Init *TernOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const {
|
|||||||
VarInit *RHSv = dyn_cast<VarInit>(RHS);
|
VarInit *RHSv = dyn_cast<VarInit>(RHS);
|
||||||
StringInit *RHSs = dyn_cast<StringInit>(RHS);
|
StringInit *RHSs = dyn_cast<StringInit>(RHS);
|
||||||
|
|
||||||
if ((LHSd && MHSd && RHSd)
|
if ((LHSd && MHSd && RHSd) ||
|
||||||
|| (LHSv && MHSv && RHSv)
|
(LHSv && MHSv && RHSv) ||
|
||||||
|| (LHSs && MHSs && RHSs)) {
|
(LHSs && MHSs && RHSs)) {
|
||||||
if (RHSd) {
|
if (RHSd) {
|
||||||
Record *Val = RHSd->getDef();
|
Record *Val = RHSd->getDef();
|
||||||
if (LHSd->getAsString() == RHSd->getAsString()) {
|
if (LHSd->getAsString() == RHSd->getAsString()) {
|
||||||
@@ -1215,8 +1215,8 @@ std::string TernOpInit::getAsString() const {
|
|||||||
case FOREACH: Result = "!foreach"; break;
|
case FOREACH: Result = "!foreach"; break;
|
||||||
case IF: Result = "!if"; break;
|
case IF: Result = "!if"; break;
|
||||||
}
|
}
|
||||||
return Result + "(" + LHS->getAsString() + ", " + MHS->getAsString() + ", "
|
return Result + "(" + LHS->getAsString() + ", " + MHS->getAsString() + ", " +
|
||||||
+ RHS->getAsString() + ")";
|
RHS->getAsString() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
RecTy *TypedInit::getFieldType(const std::string &FieldName) const {
|
RecTy *TypedInit::getFieldType(const std::string &FieldName) const {
|
||||||
@@ -1663,14 +1663,13 @@ void Record::resolveReferencesTo(const RecordVal *RV) {
|
|||||||
continue;
|
continue;
|
||||||
if (Init *V = Values[i].getValue())
|
if (Init *V = Values[i].getValue())
|
||||||
if (Values[i].setValue(V->resolveReferences(*this, RV)))
|
if (Values[i].setValue(V->resolveReferences(*this, RV)))
|
||||||
PrintFatalError(getLoc(), "Invalid value is found when setting '"
|
PrintFatalError(getLoc(), "Invalid value is found when setting '" +
|
||||||
+ Values[i].getNameInitAsString()
|
Values[i].getNameInitAsString() +
|
||||||
+ "' after resolving references"
|
"' after resolving references" +
|
||||||
+ (RV ? " against '" + RV->getNameInitAsString()
|
(RV ? " against '" + RV->getNameInitAsString() +
|
||||||
+ "' of ("
|
"' of (" + RV->getValue()->getAsUnquotedString() +
|
||||||
+ RV->getValue()->getAsUnquotedString() + ")"
|
")"
|
||||||
: "")
|
: "") + "\n");
|
||||||
+ "\n");
|
|
||||||
}
|
}
|
||||||
Init *OldName = getNameInit();
|
Init *OldName = getNameInit();
|
||||||
Init *NewName = Name->resolveReferences(*this, RV);
|
Init *NewName = Name->resolveReferences(*this, RV);
|
||||||
|
@@ -85,8 +85,8 @@ bool TGParser::SetValue(Record *CurRec, SMLoc Loc, Init *ValName,
|
|||||||
|
|
||||||
RecordVal *RV = CurRec->getValue(ValName);
|
RecordVal *RV = CurRec->getValue(ValName);
|
||||||
if (!RV)
|
if (!RV)
|
||||||
return Error(Loc, "Value '" + ValName->getAsUnquotedString()
|
return Error(Loc, "Value '" + ValName->getAsUnquotedString() +
|
||||||
+ "' unknown!");
|
"' unknown!");
|
||||||
|
|
||||||
// Do not allow assignments like 'X = X'. This will just cause infinite loops
|
// Do not allow assignments like 'X = X'. This will just cause infinite loops
|
||||||
// in the resolution machinery.
|
// in the resolution machinery.
|
||||||
@@ -102,8 +102,8 @@ bool TGParser::SetValue(Record *CurRec, SMLoc Loc, Init *ValName,
|
|||||||
if (!BitList.empty()) {
|
if (!BitList.empty()) {
|
||||||
BitsInit *CurVal = dyn_cast<BitsInit>(RV->getValue());
|
BitsInit *CurVal = dyn_cast<BitsInit>(RV->getValue());
|
||||||
if (!CurVal)
|
if (!CurVal)
|
||||||
return Error(Loc, "Value '" + ValName->getAsUnquotedString()
|
return Error(Loc, "Value '" + ValName->getAsUnquotedString() +
|
||||||
+ "' is not a bits type");
|
"' is not a bits type");
|
||||||
|
|
||||||
// Convert the incoming value to a bits type of the appropriate size...
|
// Convert the incoming value to a bits type of the appropriate size...
|
||||||
Init *BI = V->convertInitializerTo(BitsRecTy::get(BitList.size()));
|
Init *BI = V->convertInitializerTo(BitsRecTy::get(BitList.size()));
|
||||||
@@ -138,11 +138,10 @@ bool TGParser::SetValue(Record *CurRec, SMLoc Loc, Init *ValName,
|
|||||||
InitType = (Twine("' of type bit initializer with length ") +
|
InitType = (Twine("' of type bit initializer with length ") +
|
||||||
Twine(BI->getNumBits())).str();
|
Twine(BI->getNumBits())).str();
|
||||||
}
|
}
|
||||||
return Error(Loc, "Value '" + ValName->getAsUnquotedString() + "' of type '"
|
return Error(Loc, "Value '" + ValName->getAsUnquotedString() +
|
||||||
+ RV->getType()->getAsString() +
|
"' of type '" + RV->getType()->getAsString() +
|
||||||
"' is incompatible with initializer '" + V->getAsString()
|
"' is incompatible with initializer '" + V->getAsString() +
|
||||||
+ InitType
|
InitType + "'");
|
||||||
+ "'");
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -181,9 +180,9 @@ bool TGParser::AddSubClass(Record *CurRec, SubClassReference &SubClass) {
|
|||||||
|
|
||||||
} else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
|
} else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
|
||||||
return Error(SubClass.RefRange.Start,
|
return Error(SubClass.RefRange.Start,
|
||||||
"Value not specified for template argument #"
|
"Value not specified for template argument #" +
|
||||||
+ utostr(i) + " (" + TArgs[i]->getAsUnquotedString()
|
utostr(i) + " (" + TArgs[i]->getAsUnquotedString() +
|
||||||
+ ") of subclass '" + SC->getNameInitAsString() + "'!");
|
") of subclass '" + SC->getNameInitAsString() + "'!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,9 +274,9 @@ bool TGParser::AddSubMultiClass(MultiClass *CurMC,
|
|||||||
}
|
}
|
||||||
} else if (!CurRec->getValue(SMCTArgs[i])->getValue()->isComplete()) {
|
} else if (!CurRec->getValue(SMCTArgs[i])->getValue()->isComplete()) {
|
||||||
return Error(SubMultiClass.RefRange.Start,
|
return Error(SubMultiClass.RefRange.Start,
|
||||||
"Value not specified for template argument #"
|
"Value not specified for template argument #" +
|
||||||
+ utostr(i) + " (" + SMCTArgs[i]->getAsUnquotedString()
|
utostr(i) + " (" + SMCTArgs[i]->getAsUnquotedString() +
|
||||||
+ ") of subclass '" + SMC->Rec.getNameInitAsString() + "'!");
|
") of subclass '" + SMC->Rec.getNameInitAsString() + "'!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -821,9 +820,9 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) {
|
|||||||
Init *LHS = ParseValue(CurRec);
|
Init *LHS = ParseValue(CurRec);
|
||||||
if (!LHS) return nullptr;
|
if (!LHS) return nullptr;
|
||||||
|
|
||||||
if (Code == UnOpInit::HEAD
|
if (Code == UnOpInit::HEAD ||
|
||||||
|| Code == UnOpInit::TAIL
|
Code == UnOpInit::TAIL ||
|
||||||
|| Code == UnOpInit::EMPTY) {
|
Code == UnOpInit::EMPTY) {
|
||||||
ListInit *LHSl = dyn_cast<ListInit>(LHS);
|
ListInit *LHSl = dyn_cast<ListInit>(LHS);
|
||||||
StringInit *LHSs = dyn_cast<StringInit>(LHS);
|
StringInit *LHSs = dyn_cast<StringInit>(LHS);
|
||||||
TypedInit *LHSt = dyn_cast<TypedInit>(LHS);
|
TypedInit *LHSt = dyn_cast<TypedInit>(LHS);
|
||||||
@@ -840,8 +839,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Code == UnOpInit::HEAD
|
if (Code == UnOpInit::HEAD || Code == UnOpInit::TAIL) {
|
||||||
|| Code == UnOpInit::TAIL) {
|
|
||||||
if (!LHSl && !LHSt) {
|
if (!LHSl && !LHSt) {
|
||||||
TokError("expected list type argument in unary operator");
|
TokError("expected list type argument in unary operator");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -2139,8 +2137,8 @@ bool TGParser::ParseClass() {
|
|||||||
if (CurRec->getValues().size() > 1 || // Account for NAME.
|
if (CurRec->getValues().size() > 1 || // Account for NAME.
|
||||||
!CurRec->getSuperClasses().empty() ||
|
!CurRec->getSuperClasses().empty() ||
|
||||||
!CurRec->getTemplateArgs().empty())
|
!CurRec->getTemplateArgs().empty())
|
||||||
return TokError("Class '" + CurRec->getNameInitAsString()
|
return TokError("Class '" + CurRec->getNameInitAsString() +
|
||||||
+ "' already defined");
|
"' already defined");
|
||||||
} else {
|
} else {
|
||||||
// If this is the first reference to this class, create and add it.
|
// If this is the first reference to this class, create and add it.
|
||||||
auto NewRec =
|
auto NewRec =
|
||||||
@@ -2382,9 +2380,9 @@ InstantiateMulticlassDef(MultiClass &MC,
|
|||||||
// confused.
|
// confused.
|
||||||
if (SetValue(CurRec.get(), Ref.RefRange.Start, "NAME",
|
if (SetValue(CurRec.get(), Ref.RefRange.Start, "NAME",
|
||||||
std::vector<unsigned>(), DefmPrefix)) {
|
std::vector<unsigned>(), DefmPrefix)) {
|
||||||
Error(DefmPrefixRange.Start, "Could not resolve "
|
Error(DefmPrefixRange.Start, "Could not resolve " +
|
||||||
+ CurRec->getNameInitAsString() + ":NAME to '"
|
CurRec->getNameInitAsString() + ":NAME to '" +
|
||||||
+ DefmPrefix->getAsUnquotedString() + "'");
|
DefmPrefix->getAsUnquotedString() + "'");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2455,9 +2453,9 @@ bool TGParser::ResolveMulticlassDefArgs(MultiClass &MC,
|
|||||||
|
|
||||||
} else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
|
} else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
|
||||||
return Error(SubClassLoc, "value not specified for template argument #" +
|
return Error(SubClassLoc, "value not specified for template argument #" +
|
||||||
utostr(i) + " (" + TArgs[i]->getAsUnquotedString()
|
utostr(i) + " (" + TArgs[i]->getAsUnquotedString() +
|
||||||
+ ") of multiclassclass '" + MC.Rec.getNameInitAsString()
|
") of multiclassclass '" + MC.Rec.getNameInitAsString() +
|
||||||
+ "'");
|
"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user