mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 06:33:21 +00:00
[AVX] Make IntInit Unique
Use a DenseMap to make sure only one IntInit of any value exists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
726bbde3c4
commit
2855b0f073
@ -539,7 +539,12 @@ const Init *BitsInit::resolveReferences(Record &R, const RecordVal *RV) const {
|
||||
}
|
||||
|
||||
const IntInit *IntInit::get(int64_t V) {
|
||||
return new IntInit(V);
|
||||
typedef DenseMap<int64_t, IntInit *> Pool;
|
||||
static Pool ThePool;
|
||||
|
||||
IntInit *&I = ThePool[V];
|
||||
if (!I) I = new IntInit(V);
|
||||
return I;
|
||||
}
|
||||
|
||||
std::string IntInit::getAsString() const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user