diff options
| author | 2017-10-04 20:27:34 +0000 | |
|---|---|---|
| committer | 2017-10-04 20:27:34 +0000 | |
| commit | 31eb748944903b7f4f38afda9851951ca9dfc1ae (patch) | |
| tree | 9b95b6ea45d0874d75eb05b90c0840e191416439 /gnu/llvm/lib/MC/ConstantPools.cpp | |
| parent | Don't try to handle IPv4-compatible IPv6 addresses (diff) | |
| download | wireguard-openbsd-31eb748944903b7f4f38afda9851951ca9dfc1ae.tar.xz wireguard-openbsd-31eb748944903b7f4f38afda9851951ca9dfc1ae.zip | |
Import LLVM 5.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/MC/ConstantPools.cpp')
| -rw-r--r-- | gnu/llvm/lib/MC/ConstantPools.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gnu/llvm/lib/MC/ConstantPools.cpp b/gnu/llvm/lib/MC/ConstantPools.cpp index 9608c2c656b..ca5440237e4 100644 --- a/gnu/llvm/lib/MC/ConstantPools.cpp +++ b/gnu/llvm/lib/MC/ConstantPools.cpp @@ -1,4 +1,4 @@ -//===- ConstantPools.cpp - ConstantPool class --*- C++ -*---------===// +//===- ConstantPools.cpp - ConstantPool class -----------------------------===// // // The LLVM Compiler Infrastructure // @@ -10,13 +10,16 @@ // This file implements the ConstantPool and AssemblerConstantPools classes. // //===----------------------------------------------------------------------===// -#include "llvm/ADT/MapVector.h" + #include "llvm/MC/ConstantPools.h" #include "llvm/MC/MCContext.h" +#include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCStreamer.h" +#include "llvm/Support/Casting.h" using namespace llvm; + // // ConstantPool implementation // @@ -54,6 +57,10 @@ const MCExpr *ConstantPool::addEntry(const MCExpr *Value, MCContext &Context, bool ConstantPool::empty() { return Entries.empty(); } +void ConstantPool::clearCache() { + CachedEntries.clear(); +} + // // AssemblerConstantPools implementation // @@ -95,6 +102,13 @@ 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) { |
