Revert "[ARM] Clear the constant pool cache on explicit .ltorg directives"
authorJames Molloy <james.molloy@arm.com>
Mon, 22 May 2017 08:49:28 +0000 (08:49 +0000)
committerJames Molloy <james.molloy@arm.com>
Mon, 22 May 2017 08:49:28 +0000 (08:49 +0000)
This reverts commit r302416. This was a fixup for r286006, which has now been reverted so this doesn't apply (either in concept or in code).

This commit itself has no problems, but the underlying issue it was fixing has now disappeared from the codebase.

llvm-svn: 303536

llvm/include/llvm/MC/ConstantPools.h
llvm/lib/MC/ConstantPools.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp
llvm/test/MC/ARM/ltorg-range.s [deleted file]

index f1f9c37..e923300 100644 (file)
@@ -61,8 +61,6 @@ public:
 
   // Return true if the constant pool is empty
   bool empty();
-
-  void clearCache();
 };
 
 class AssemblerConstantPools {
@@ -86,7 +84,6 @@ class AssemblerConstantPools {
 public:
   void emitAll(MCStreamer &Streamer);
   void emitForCurrentSection(MCStreamer &Streamer);
-  void clearCacheForCurrentSection(MCStreamer &Streamer);
   const MCExpr *addEntry(MCStreamer &Streamer, const MCExpr *Expr,
                          unsigned Size, SMLoc Loc);
 
index a217b23..1763d09 100644 (file)
@@ -47,10 +47,6 @@ const MCExpr *ConstantPool::addEntry(const MCExpr *Value, MCContext &Context,
 
 bool ConstantPool::empty() { return Entries.empty(); }
 
-void ConstantPool::clearCache() {
-  CachedEntries.clear();
-}
-
 //
 // AssemblerConstantPools implementation
 //
@@ -92,13 +88,6 @@ void AssemblerConstantPools::emitForCurrentSection(MCStreamer &Streamer) {
   }
 }
 
-void AssemblerConstantPools::clearCacheForCurrentSection(MCStreamer &Streamer) {
-  MCSection *Section = Streamer.getCurrentSectionOnly();
-  if (ConstantPool *CP = getConstantPool(Section)) {
-    CP->clearCache();
-  }
-}
-
 const MCExpr *AssemblerConstantPools::addEntry(MCStreamer &Streamer,
                                                const MCExpr *Expr,
                                                unsigned Size, SMLoc Loc) {
index 4a94318..2b0cd46 100644 (file)
@@ -38,7 +38,6 @@ const MCExpr *ARMTargetStreamer::addConstantPoolEntry(const MCExpr *Expr, SMLoc
 
 void ARMTargetStreamer::emitCurrentConstantPool() {
   ConstantPools->emitForCurrentSection(Streamer);
-  ConstantPools->clearCacheForCurrentSection(Streamer);
 }
 
 // finish() - write out any non-empty assembler constant pools.
diff --git a/llvm/test/MC/ARM/ltorg-range.s b/llvm/test/MC/ARM/ltorg-range.s
deleted file mode 100644 (file)
index 5c27d4c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-@ RUN: llvm-mc -triple armv7-unknown-linux-gnueabi -filetype obj -o - %s \
-@ RUN:   | llvm-objdump -d - | FileCheck %s
-
-        ldr r0, =0x01020304
-@ CHECK: ldr
-        .ltorg
-@ CHECK: 0x01020304
-        ldr r0, =0x01020304
-        ldr r0, =0x01020304
-        ldr r0, =0x01020304
-@ CHECK: ldr
-@ CHECK: ldr
-@ CHECK: ldr
-        .ltorg
-@ CHECK: 0x01020304
-    .rep 1028
-        .word 0
-    .endr
-@ CHECK: 0x00000000
-
-        ldr r0, =0x01020304
-@ CHECK: ldr
-        .ltorg
-@ CHECK: 0x01020304
-    .rep 1028
-        .word 0
-    .endr