diff options
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(); } |