From ec9072d661d00c1c869d63d9740f1d55d1c85393 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 14 May 2015 05:53:53 +0000 Subject: [TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() if it was just comparing to 0. NFC. llvm-svn: 237340 --- llvm/lib/TableGen/Record.cpp | 6 +++--- llvm/lib/TableGen/TGParser.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/TableGen') diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index ad9aea20449..9c8a06f2b5f 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -778,14 +778,14 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const { } case HEAD: { if (ListInit *LHSl = dyn_cast(LHS)) { - assert(LHSl->getSize() != 0 && "Empty list in car"); + assert(!LHSl->empty() && "Empty list in car"); return LHSl->getElement(0); } break; } case TAIL: { if (ListInit *LHSl = dyn_cast(LHS)) { - assert(LHSl->getSize() != 0 && "Empty list in cdr"); + assert(!LHSl->empty() && "Empty list in cdr"); // Note the +1. We can't just pass the result of getValues() // directly. return ListInit::get(LHSl->getValues().slice(1), LHSl->getType()); @@ -794,7 +794,7 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const { } case EMPTY: { if (ListInit *LHSl = dyn_cast(LHS)) { - if (LHSl->getSize() == 0) + if (LHSl->empty()) return IntInit::get(1); return IntInit::get(0); } diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 56f156dceab..23ef5354fca 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -841,7 +841,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { return nullptr; } - if (LHSl && LHSl->getSize() == 0) { + if (LHSl && LHSl->empty()) { TokError("empty list argument in unary operator"); return nullptr; } -- cgit v1.2.3