OSDN Git Service

[TableGen] Allow 2^63-1 and 2^63-2 as int literals.
authorSimon Tatham <simon.tatham@arm.com>
Tue, 12 Mar 2019 09:28:19 +0000 (09:28 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Tue, 12 Mar 2019 09:28:19 +0000 (09:28 +0000)
commit8183de62fd440d71808e32ee3efff584adbf60ce
tree040431f203fa1518126c614ec39cf20586652019
parent456da09d906f4eef5fd221da139f6a78b20360a8
[TableGen] Allow 2^63-1 and 2^63-2 as int literals.

These two values correspond to the 'Empty' and 'Tombstone' special
keys defined by DenseMapInfo<int64_t>, which means that neither one
can be used as a key in DenseMap<int64_t, anything>. Hence, if you try
to use either of those values as an int literal, IntInit::get() fails
an assertion when it tries to insert them into its static cache of
int-literal objects.

Fixed by replacing the DenseMap with a std::map, which doesn't intrude
on the space of legal values of the key type.

Reviewers: nhaehnle, hfinkel, javedabsar, efriedma

Reviewed By: efriedma

Subscribers: fhahn, efriedma, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59016

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355900 91177308-0d34-0410-b5e6-96231b3b80d8
lib/TableGen/Record.cpp
test/TableGen/IntSpecialValues.td [new file with mode: 0644]