projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use range-based for loops. NFC
[oota-llvm.git]
/
lib
/
MC
/
ConstantPools.cpp
diff --git
a/lib/MC/ConstantPools.cpp
b/lib/MC/ConstantPools.cpp
index 41ce68bfe0a581e9ce559adf16201baec6f717cc..f7649fba6e896aab85cfc5a70f2504eeb1f1c357 100644
(file)
--- a/
lib/MC/ConstantPools.cpp
+++ b/
lib/MC/ConstantPools.cpp
@@
-11,10
+11,10
@@
//
//===----------------------------------------------------------------------===//
#include "llvm/ADT/MapVector.h"
//
//===----------------------------------------------------------------------===//
#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/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCStreamer.h"
-#include "llvm/MC/ConstantPools.h"
using namespace llvm;
//
using namespace llvm;
//
@@
-37,10
+37,10
@@
void ConstantPool::emitEntries(MCStreamer &Streamer) {
const MCExpr *ConstantPool::addEntry(const MCExpr *Value, MCContext &Context,
unsigned Size) {
const MCExpr *ConstantPool::addEntry(const MCExpr *Value, MCContext &Context,
unsigned Size) {
- MCSymbol *CPEntryLabel = Context.
C
reateTempSymbol();
+ MCSymbol *CPEntryLabel = Context.
c
reateTempSymbol();
- Entries.push_back(
{ CPEntryLabel, Value, Size }
);
- return MCSymbolRefExpr::
C
reate(CPEntryLabel, Context);
+ Entries.push_back(
ConstantPoolEntry(CPEntryLabel, Value, Size)
);
+ return MCSymbolRefExpr::
c
reate(CPEntryLabel, Context);
}
bool ConstantPool::empty() { return Entries.empty(); }
}
bool ConstantPool::empty() { return Entries.empty(); }
@@
-48,8
+48,7
@@
bool ConstantPool::empty() { return Entries.empty(); }
//
// AssemblerConstantPools implementation
//
//
// 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;
ConstantPoolMapTy::iterator CP = ConstantPools.find(Section);
if (CP == ConstantPools.end())
return nullptr;
@@
-58,11
+57,11
@@
AssemblerConstantPools::getConstantPool(const MCSection *Section) {
}
ConstantPool &
}
ConstantPool &
-AssemblerConstantPools::getOrCreateConstantPool(
const
MCSection *Section) {
+AssemblerConstantPools::getOrCreateConstantPool(MCSection *Section) {
return ConstantPools[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);
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) {
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);
ConstantPool &CP = CPI->second;
emitConstantPool(Streamer, Section, CP);
@@
-83,7
+82,7
@@
void AssemblerConstantPools::emitAll(MCStreamer &Streamer) {
}
void AssemblerConstantPools::emitForCurrentSection(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);
}
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 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);
}
return getOrCreateConstantPool(Section).addEntry(Expr, Streamer.getContext(),
Size);
}