]> granicus.if.org Git - llvm/commit
[MC] Fix constant pools with DenseMap sentinel values
authorOliver Stannard <oliver.stannard@arm.com>
Tue, 30 May 2017 09:37:11 +0000 (09:37 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Tue, 30 May 2017 09:37:11 +0000 (09:37 +0000)
commit94eec101b380a2e04e1ef9ed8b030393c1b744e5
tree0b429a4c03b6f9037c0a6a2557492ffa832ec0a7
parentdb736ce4a1358edc257eadd9f9efd4d053b4df9a
[MC] Fix constant pools with DenseMap sentinel values

The MC ConstantPool class uses a DenseMap to track generated constants, with
the int64_t value of the constant as the key. This fails when values of
0x7fffffffffffffff or 0x7ffffffffffffffe are inserted into the constant pool, as
these are sentinel values for DenseMap.

The fix is to use std::map instead, which doesn't use sentinel values.

Differential revision: https://reviews.llvm.org/D33667

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304199 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/ConstantPools.h
test/MC/AArch64/ldr-pseudo.s