mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-05 02:28:51 +00:00
[AVX] Make IntInit Unique
Use a DenseMap to make sure only one IntInit of any value exists. llvm-svn: 136490
This commit is contained in:
parent
a527d6a682
commit
b6f328122b
@ -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…
Reference in New Issue
Block a user