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
// Return true if the constant pool is empty
bool empty();
-
- void clearCache();
};
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);
bool ConstantPool::empty() { return Entries.empty(); }
-void ConstantPool::clearCache() {
- CachedEntries.clear();
-}
-
//
// AssemblerConstantPools implementation
//
}
}
-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) {
void ARMTargetStreamer::emitCurrentConstantPool() {
ConstantPools->emitForCurrentSection(Streamer);
- ConstantPools->clearCacheForCurrentSection(Streamer);
}
// finish() - write out any non-empty assembler constant pools.
+++ /dev/null
-@ 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