mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +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:
@@ -539,7 +539,12 @@ const Init *BitsInit::resolveReferences(Record &R, const RecordVal *RV) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const IntInit *IntInit::get(int64_t V) {
|
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 {
|
std::string IntInit::getAsString() const {
|
||||||
|
Reference in New Issue
Block a user