diff options
author | Craig Topper <craig.topper@gmail.com> | 2015-05-14 05:53:53 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2015-05-14 05:53:53 +0000 |
commit | ec9072d661d00c1c869d63d9740f1d55d1c85393 (patch) | |
tree | d2e8a47f0bf55a4e75e404dfa2d280f7c670a4fd /llvm/lib/TableGen | |
parent | e7aad46665c73f8e7c9d34f3d54013e1fc7e00ae (diff) | |
download | bcm5719-llvm-ec9072d661d00c1c869d63d9740f1d55d1c85393.tar.gz bcm5719-llvm-ec9072d661d00c1c869d63d9740f1d55d1c85393.zip |
[TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() if it was just comparing to 0. NFC.
llvm-svn: 237340
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r-- | llvm/lib/TableGen/Record.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/TableGen/TGParser.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
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<ListInit>(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<ListInit>(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<ListInit>(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; } |