summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen
diff options
context:
space:
mode:
authorMichael Liao <michael.hliao@gmail.com>2019-10-22 12:11:25 -0400
committerMichael Liao <michael.hliao@gmail.com>2019-10-22 15:26:30 -0400
commita7cebfe9c03d0561500d3ab6d7ca2cea4a197904 (patch)
tree1caadbb096afcdeed149f181c12da50f0f343759 /llvm/utils/TableGen
parent8be5827f85619a09fecc47544f649b7503e91396 (diff)
downloadbcm5719-llvm-a7cebfe9c03d0561500d3ab6d7ca2cea4a197904.tar.gz
bcm5719-llvm-a7cebfe9c03d0561500d3ab6d7ca2cea4a197904.zip
Relax assertions when there's really no entries. [NFC]
Diffstat (limited to 'llvm/utils/TableGen')
-rw-r--r--llvm/utils/TableGen/SequenceToOffsetTable.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/SequenceToOffsetTable.h b/llvm/utils/TableGen/SequenceToOffsetTable.h
index 8a826eff311..327da39f477 100644
--- a/llvm/utils/TableGen/SequenceToOffsetTable.h
+++ b/llvm/utils/TableGen/SequenceToOffsetTable.h
@@ -83,7 +83,7 @@ public:
bool empty() const { return Seqs.empty(); }
unsigned size() const {
- assert(Entries && "Call layout() before size()");
+ assert((empty() || Entries) && "Call layout() before size()");
return Entries;
}
@@ -113,7 +113,7 @@ public:
void emit(raw_ostream &OS,
void (*Print)(raw_ostream&, ElemT),
const char *Term = "0") const {
- assert(Entries && "Call layout() before emit()");
+ assert((empty() || Entries) && "Call layout() before emit()");
for (typename SeqMap::const_iterator I = Seqs.begin(), E = Seqs.end();
I != E; ++I) {
OS << " /* " << I->second << " */ ";
OpenPOWER on IntegriCloud