diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-08-19 00:42:32 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-08-19 00:42:32 +0000 |
| commit | 8d12558bad480493253c4bdc793244673a78e2c4 (patch) | |
| tree | 27b79157e82b4103a0c9a088ce48e8150b4a5662 /llvm/lib/IR/LLVMContextImpl.h | |
| parent | 3fa26b7661273baf0f059ff9f1b067c4b70cc7ab (diff) | |
| download | bcm5719-llvm-8d12558bad480493253c4bdc793244673a78e2c4.tar.gz bcm5719-llvm-8d12558bad480493253c4bdc793244673a78e2c4.zip | |
IR: Rewrite ConstantUniqueMap
Rewrite `ConstantUniqueMap` to be more similar to
`ConstantAggrUniqueMap`.
- Use a `DenseMap` with custom MapInfo instead of a `std::map` with
linear lookups and deletion.
- Don't waste memory explicitly storing (heavyweight) keys.
Only `ConstantExpr` and `InlineAsm` actually use this data structure, so
I also updated them to use it.
This code cleanup is a precursor to reducing RAUW traffic on
`ConstantExpr` -- I felt badly adding a new (linear) call to
`ConstantUniqueMap::FindExistingKey`, so this designs away the concern.
A follow-up commit will transition the users of `ConstantAggrUniqueMap`
over.
llvm-svn: 215957
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.h')
| -rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index 1eead4ad41d..b6a6254ba6a 100644 --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -289,11 +289,9 @@ public: DenseMap<std::pair<const Function *, const BasicBlock *>, BlockAddress *> BlockAddresses; - ConstantUniqueMap<ExprMapKeyType, const ExprMapKeyType&, Type, ConstantExpr> - ExprConstants; + ConstantUniqueMap<ConstantExpr> ExprConstants; - ConstantUniqueMap<InlineAsmKeyType, const InlineAsmKeyType&, PointerType, - InlineAsm> InlineAsms; + ConstantUniqueMap<InlineAsm> InlineAsms; ConstantInt *TheTrueVal; ConstantInt *TheFalseVal; |

