Chromium Code Reviews| Index: src/IceGlobalContext.cpp |
| diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp |
| index 4bb9b7d29ddced2e57c43ef227b8beb9ef3f6c7b..317385557735581182a84b27d0f1e4470ea652a9 100644 |
| --- a/src/IceGlobalContext.cpp |
| +++ b/src/IceGlobalContext.cpp |
| @@ -44,8 +44,7 @@ |
| namespace std { |
| template <> struct hash<Ice::RelocatableTuple> { |
| size_t operator()(const Ice::RelocatableTuple &Key) const { |
| - return hash<Ice::IceString>()(Key.Name) + |
| - hash<Ice::RelocOffsetT>()(Key.Offset); |
| + return hash<Ice::IceString>()(Key.Name); |
|
Jim Stichnoth
2016/02/02 17:13:44
Any reason not to add some aspect of OffsetExpr in
John
2016/02/02 19:36:39
Done.
|
| } |
| }; |
| } // end of namespace std |
| @@ -785,18 +784,26 @@ Constant *GlobalContext::getConstantDouble(double ConstantDouble) { |
| return getConstPool()->Doubles.getOrAdd(this, ConstantDouble); |
| } |
| -Constant *GlobalContext::getConstantSym(RelocOffsetT Offset, |
| +Constant *GlobalContext::getConstantSym(std::vector<RelocOffset *> Offset, |
| const IceString &Name, |
| bool SuppressMangling) { |
| return getConstPool()->Relocatables.getOrAdd( |
| - this, RelocatableTuple(Offset, Name, SuppressMangling)); |
| + this, RelocatableTuple(std::move(Offset), Name, SuppressMangling)); |
| +} |
| + |
| +Constant *GlobalContext::getConstantSym(RelocOffsetT Offset, |
| + const IceString &Name, |
| + bool SuppressMangling) { |
| + return getConstantSym({RelocOffset::create(this, Offset)}, Name, |
| + SuppressMangling); |
| } |
| Constant *GlobalContext::getConstantExternSym(const IceString &Name) { |
| constexpr RelocOffsetT Offset = 0; |
| constexpr bool SuppressMangling = true; |
| return getConstPool()->ExternRelocatables.getOrAdd( |
| - this, RelocatableTuple(Offset, Name, SuppressMangling)); |
| + this, RelocatableTuple({RelocOffset::create(this, Offset)}, Name, |
| + SuppressMangling)); |
| } |
| Constant *GlobalContext::getConstantUndef(Type Ty) { |