]> granicus.if.org Git - llvm/commitdiff
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303536 91177308-0d34-0410-b5e6-96231b3b80d8

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

index f1f9c37fe34e8ec70008085bc865233880218bcf..e9233007b11b5a51b0b64761c632a6bbf39c15e8 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 a217b23207b1eeac0909998cadb401ac141fd37a..1763d099115cb717e5a4fc7f6373ade943e9045a 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 4a943187ab6da611825e796c569ae18e2bd5ce59..2b0cd461df7af8174d25659073cc347cedb46a66 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/test/MC/ARM/ltorg-range.s b/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