1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 14:02:52 +02:00

[AVX] Make CodeInit Unique

Use a StringMap to ensure CodeInits are unique and created only
once.

llvm-svn: 136492
This commit is contained in:
David Greene 2011-07-29 19:07:15 +00:00
parent 94a66246c5
commit 94607ffc67

View File

@ -575,7 +575,12 @@ const StringInit *StringInit::get(const std::string &V) {
}
const CodeInit *CodeInit::get(const std::string &V) {
return new CodeInit(V);
typedef StringMap<CodeInit *> Pool;
static Pool ThePool;
CodeInit *&I = ThePool[V];
if (!I) I = new CodeInit(V);
return I;
}
const ListInit *ListInit::get(ArrayRef<const Init *> Range, RecTy *EltTy) {