diff options
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
| -rw-r--r-- | llvm/lib/TableGen/TGParser.cpp | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 87a1fb64943c..62c535565414 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -240,17 +240,15 @@ bool TGParser::SetValue(Record *CurRec, SMLoc Loc, const Init *ValName, return Error(Loc, "Value '" + ValName->getAsUnquotedString() + "' 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. if (BitList.empty()) if (const auto *VI = dyn_cast<VarInit>(V)) if (VI->getNameInit() == ValName && !AllowSelfAssignment) return Error(Loc, "Recursion / self-assignment forbidden"); - // If we are assigning to a subset of the bits in the value... then we must be - // assigning to a field of BitsRecTy, which must have a BitsInit - // initializer. - // + // If we are assigning to a subset of the bits in the value we must be + // assigning to a field of BitsRecTy, which must have a BitsInit initializer. if (!BitList.empty()) { const auto *CurVal = dyn_cast<BitsInit>(RV->getValue()); if (!CurVal) @@ -427,9 +425,9 @@ bool TGParser::resolve(const ForeachLoop &Loop, SubstStack &Substs, const Init *List = Loop.ListValue->resolveReferences(R); // For if-then-else blocks, we lower to a foreach loop whose list is a - // ternary selection between lists of different length. Since we don't + // ternary selection between lists of different length. Since we don't // have a means to track variable length record lists, we *must* resolve - // the condition here. We want to defer final resolution of the arms + // the condition here. We want to defer final resolution of the arms // until the resulting records are finalized. // e.g. !if(!exists<SchedWrite>("__does_not_exist__"), [1], []) if (const auto *TI = dyn_cast<TernOpInit>(List); @@ -700,7 +698,7 @@ const Init *TGParser::ParseObjectName(MultiClass *CurMultiClass) { return Name; } -/// ParseClassID - Parse and resolve a reference to a class name. This returns +/// ParseClassID - Parse and resolve a reference to a class name. This returns /// null on error. /// /// ClassID ::= ID @@ -788,7 +786,7 @@ ParseSubClassReference(Record *CurRec, bool isDefm) { } /// ParseSubMultiClassReference - Parse a reference to a subclass or to a -/// templated submulticlass. This returns a SubMultiClassRefTy with a null +/// templated submulticlass. This returns a SubMultiClassRefTy with a null /// Record* on error. /// /// SubMultiClassRef ::= MultiClassID @@ -1078,7 +1076,7 @@ bool TGParser::ParseOptionalBitList(SmallVectorImpl<unsigned> &Ranges) { return false; } -/// ParseType - Parse and return a tblgen type. This returns null on error. +/// ParseType - Parse and return a tblgen type. This returns null on error. /// /// Type ::= STRING // string type /// Type ::= CODE // code type @@ -1180,7 +1178,7 @@ const Init *TGParser::ParseIDValue(Record *CurRec, const StringInit *Name, return nullptr; } -/// ParseOperation - Parse an operator. This returns null on error. +/// ParseOperation - Parse an operator. This returns null on error. /// /// Operation ::= XOperator ['<' Type '>'] '(' Args ')' /// @@ -2253,7 +2251,7 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) { } } -/// ParseOperatorType - Parse a type for an operator. This returns +/// ParseOperatorType - Parse a type for an operator. This returns /// null on error. /// /// OperatorType ::= '<' Type '>' @@ -2670,7 +2668,7 @@ const Init *TGParser::ParseOperationCond(Record *CurRec, return CondOpInit::get(Case, Val, Type)->Fold(CurRec); } -/// ParseSimpleValue - Parse a tblgen value. This returns null on error. +/// ParseSimpleValue - Parse a tblgen value. This returns null on error. /// /// SimpleValue ::= IDValue /// SimpleValue ::= INTVAL @@ -2803,7 +2801,7 @@ const Init *TGParser::ParseSimpleValue(Record *CurRec, const RecTy *ItemType, SmallVector<const Init *, 16> NewBits; // As we parse { a, b, ... }, 'a' is the highest bit, but we parse it - // first. We'll first read everything in to a vector, then we can reverse + // first. We'll first read everything in to a vector, then we can reverse // it to get the bits in the correct order for the BitsInit value. for (unsigned i = 0, e = Vals.size(); i != e; ++i) { // FIXME: The following two loops would not be duplicated @@ -3319,10 +3317,10 @@ bool TGParser::ParseTemplateArgValueList( } /// ParseDeclaration - Read a declaration, returning the name of field ID, or an -/// empty string on error. This can happen in a number of different contexts, +/// empty string on error. This can happen in a number of different contexts, /// including within a def or in the template args for a class (in which case /// CurRec will be non-null) and within the template args for a multiclass (in -/// which case CurRec will be null, but CurMultiClass will be set). This can +/// which case CurRec will be null, but CurMultiClass will be set). This can /// also happen within a def that is within a multiclass, which will set both /// CurRec and CurMultiClass. /// @@ -3384,7 +3382,7 @@ const Init *TGParser::ParseDeclaration(Record *CurRec, if (!Val || SetValue(CurRec, ValLoc, DeclName, {}, Val, /*AllowSelfAssignment=*/false, /*OverrideDefLoc=*/false)) { - // Return the name, even if an error is thrown. This is so that we can + // Return the name, even if an error is thrown. This is so that we can // continue to make some progress, even without the value having been // initialized. return DeclName; @@ -3395,7 +3393,7 @@ const Init *TGParser::ParseDeclaration(Record *CurRec, } /// ParseForeachDeclaration - Read a foreach declaration, returning -/// the name of the declared object or a NULL Init on error. Return +/// the name of the declared object or a NULL Init on error. Return /// the name of the parsed initializer list through ForeachListName. /// /// ForeachDeclaration ::= ID '=' '{' RangeList '}' @@ -3477,7 +3475,7 @@ TGParser::ParseForeachDeclaration(const Init *&ForeachListValue) { } /// ParseTemplateArgList - Read a template argument list, which is a non-empty -/// sequence of template-declarations in <>'s. If CurRec is non-null, these are +/// sequence of template-declarations in <>'s. If CurRec is non-null, these are /// template args for a class. If null, these are the template args for a /// multiclass. /// @@ -3578,7 +3576,7 @@ bool TGParser::ParseBodyItem(Record *CurRec) { return SetValue(CurRec, IdLoc, FieldName, BitList, Val); } -/// ParseBody - Read the body of a class or def. Return true on error, false on +/// ParseBody - Read the body of a class or def. Return true on error, false on /// success. /// /// Body ::= ';' @@ -3641,8 +3639,8 @@ bool TGParser::ApplyLetStack(RecordsEntry &Entry) { return false; } -/// ParseObjectBody - Parse the body of a def or class. This consists of an -/// optional ClassList followed by a Body. CurRec is the current def or class +/// ParseObjectBody - Parse the body of a def or class. This consists of an +/// optional ClassList followed by a Body. CurRec is the current def or class /// that is being parsed. /// /// ObjectBody ::= BaseClassList Body @@ -3841,8 +3839,8 @@ bool TGParser::ParseDefvar(Record *CurRec) { return false; } -/// ParseForeach - Parse a for statement. Return the record corresponding -/// to it. This returns true on error. +/// ParseForeach - Parse a for statement. Return the record corresponding +/// to it. This returns true on error. /// /// Foreach ::= FOREACH Declaration IN '{ ObjectList '}' /// Foreach ::= FOREACH Declaration IN Object @@ -4129,7 +4127,7 @@ void TGParser::ParseLetList(SmallVectorImpl<LetRecord> &Result) { } while (consume(tgtok::comma)); } -/// ParseTopLevelLet - Parse a 'let' at top level. This can be a couple of +/// ParseTopLevelLet - Parse a 'let' at top level. This can be a couple of /// different related productions. This works inside multiclasses too. /// /// Object ::= LET LetList IN '{' ObjectList '}' |
