From: Craig Topper Date: Thu, 30 Apr 2015 05:54:22 +0000 (+0000) Subject: [TableGen] Cleanup formatting by moving operators from beginning of line to end of... X-Git-Tag: llvmorg-3.7.0-rc1~5649 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85c07007ea6518ef178bf94fc5d3c142718e5d9a;p=platform%2Fupstream%2Fllvm.git [TableGen] Cleanup formatting by moving operators from beginning of line to end of previous line. NFC llvm-svn: 236206 --- diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index 58f2f07..089f380 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -1114,9 +1114,9 @@ Init *TernOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const { VarInit *RHSv = dyn_cast(RHS); StringInit *RHSs = dyn_cast(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); diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 9bd6cc6..1efff04 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -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(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(LHS); StringInit *LHSs = dyn_cast(LHS); TypedInit *LHSt = dyn_cast(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(), 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;