mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 00:11:00 +00:00
[AVX] Make VarListElementInit Unique
Make sure VarListElementInits are unique and created only once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136499 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aa839b8fa3
commit
08f71e3e74
@ -1414,7 +1414,16 @@ const Init *VarBitInit::resolveReferences(Record &R,
|
||||
|
||||
const VarListElementInit *VarListElementInit::get(const TypedInit *T,
|
||||
unsigned E) {
|
||||
return new VarListElementInit(T, E);
|
||||
typedef std::pair<const TypedInit *, unsigned> Key;
|
||||
typedef DenseMap<Key, VarListElementInit *> Pool;
|
||||
|
||||
static Pool ThePool;
|
||||
|
||||
Key TheKey(std::make_pair(T, E));
|
||||
|
||||
VarListElementInit *&I = ThePool[TheKey];
|
||||
if (!I) I = new VarListElementInit(T, E);
|
||||
return I;
|
||||
}
|
||||
|
||||
std::string VarListElementInit::getAsString() const {
|
||||
|
Loading…
Reference in New Issue
Block a user