diff options
author | James Molloy <james.molloy@arm.com> | 2017-05-22 08:42:47 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2017-05-22 08:42:47 +0000 |
commit | 5a9cf2e22d9d88bb550caf664db296bbbd6c6279 (patch) | |
tree | 31ef346da060e34bedbfc4635f2267f277559dc2 /llvm/lib/MC/ConstantPools.cpp | |
parent | 9976efa8ffe039807dc7d2fad187471436bb3e73 (diff) | |
download | llvm-5a9cf2e22d9d88bb550caf664db296bbbd6c6279.zip llvm-5a9cf2e22d9d88bb550caf664db296bbbd6c6279.tar.gz llvm-5a9cf2e22d9d88bb550caf664db296bbbd6c6279.tar.bz2 |
Revert "Fix 24560: assembler does not share constant pool for same constants"
This reverts commit r286006. It caused PR32825 and wasn't fixed.
llvm-svn: 303535
Diffstat (limited to 'llvm/lib/MC/ConstantPools.cpp')
-rw-r--r-- | llvm/lib/MC/ConstantPools.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/llvm/lib/MC/ConstantPools.cpp b/llvm/lib/MC/ConstantPools.cpp index ca54402..a217b23 100644 --- a/llvm/lib/MC/ConstantPools.cpp +++ b/llvm/lib/MC/ConstantPools.cpp @@ -39,20 +39,10 @@ void ConstantPool::emitEntries(MCStreamer &Streamer) { const MCExpr *ConstantPool::addEntry(const MCExpr *Value, MCContext &Context, unsigned Size, SMLoc Loc) { - const MCConstantExpr *C = dyn_cast<MCConstantExpr>(Value); - - // Check if there is existing entry for the same constant. If so, reuse it. - auto Itr = C ? CachedEntries.find(C->getValue()) : CachedEntries.end(); - if (Itr != CachedEntries.end()) - return Itr->second; - MCSymbol *CPEntryLabel = Context.createTempSymbol(); Entries.push_back(ConstantPoolEntry(CPEntryLabel, Value, Size, Loc)); - const auto SymRef = MCSymbolRefExpr::create(CPEntryLabel, Context); - if (C) - CachedEntries[C->getValue()] = SymRef; - return SymRef; + return MCSymbolRefExpr::create(CPEntryLabel, Context); } bool ConstantPool::empty() { return Entries.empty(); } |