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