X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FMC%2FConstantPools.cpp;h=f7649fba6e896aab85cfc5a70f2504eeb1f1c357;hb=f0d29aad5c11929c872237204897fc5855f16140;hp=41ce68bfe0a581e9ce559adf16201baec6f717cc;hpb=12f33da20bbb303c3ebba0b80b41245767eee228;p=oota-llvm.git diff --git a/lib/MC/ConstantPools.cpp b/lib/MC/ConstantPools.cpp index 41ce68bfe0a..f7649fba6e8 100644 --- a/lib/MC/ConstantPools.cpp +++ b/lib/MC/ConstantPools.cpp @@ -11,10 +11,10 @@ // //===----------------------------------------------------------------------===// #include "llvm/ADT/MapVector.h" +#include "llvm/MC/ConstantPools.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/MC/ConstantPools.h" using namespace llvm; // @@ -37,10 +37,10 @@ void ConstantPool::emitEntries(MCStreamer &Streamer) { const MCExpr *ConstantPool::addEntry(const MCExpr *Value, MCContext &Context, unsigned Size) { - MCSymbol *CPEntryLabel = Context.CreateTempSymbol(); + MCSymbol *CPEntryLabel = Context.createTempSymbol(); - Entries.push_back( { CPEntryLabel, Value, Size } ); - return MCSymbolRefExpr::Create(CPEntryLabel, Context); + Entries.push_back(ConstantPoolEntry(CPEntryLabel, Value, Size)); + return MCSymbolRefExpr::create(CPEntryLabel, Context); } bool ConstantPool::empty() { return Entries.empty(); } @@ -48,8 +48,7 @@ bool ConstantPool::empty() { return Entries.empty(); } // // AssemblerConstantPools implementation // -ConstantPool * -AssemblerConstantPools::getConstantPool(const MCSection *Section) { +ConstantPool *AssemblerConstantPools::getConstantPool(MCSection *Section) { ConstantPoolMapTy::iterator CP = ConstantPools.find(Section); if (CP == ConstantPools.end()) return nullptr; @@ -58,11 +57,11 @@ AssemblerConstantPools::getConstantPool(const MCSection *Section) { } ConstantPool & -AssemblerConstantPools::getOrCreateConstantPool(const MCSection *Section) { +AssemblerConstantPools::getOrCreateConstantPool(MCSection *Section) { return ConstantPools[Section]; } -static void emitConstantPool(MCStreamer &Streamer, const MCSection *Section, +static void emitConstantPool(MCStreamer &Streamer, MCSection *Section, ConstantPool &CP) { if (!CP.empty()) { Streamer.SwitchSection(Section); @@ -75,7 +74,7 @@ void AssemblerConstantPools::emitAll(MCStreamer &Streamer) { for (ConstantPoolMapTy::iterator CPI = ConstantPools.begin(), CPE = ConstantPools.end(); CPI != CPE; ++CPI) { - const MCSection *Section = CPI->first; + MCSection *Section = CPI->first; ConstantPool &CP = CPI->second; emitConstantPool(Streamer, Section, CP); @@ -83,7 +82,7 @@ void AssemblerConstantPools::emitAll(MCStreamer &Streamer) { } void AssemblerConstantPools::emitForCurrentSection(MCStreamer &Streamer) { - const MCSection *Section = Streamer.getCurrentSection().first; + MCSection *Section = Streamer.getCurrentSection().first; if (ConstantPool *CP = getConstantPool(Section)) { emitConstantPool(Streamer, Section, *CP); } @@ -92,7 +91,7 @@ void AssemblerConstantPools::emitForCurrentSection(MCStreamer &Streamer) { const MCExpr *AssemblerConstantPools::addEntry(MCStreamer &Streamer, const MCExpr *Expr, unsigned Size) { - const MCSection *Section = Streamer.getCurrentSection().first; + MCSection *Section = Streamer.getCurrentSection().first; return getOrCreateConstantPool(Section).addEntry(Expr, Streamer.getContext(), Size); }