summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Analysis/RegionPass.cpp2
-rw-r--r--llvm/lib/CodeGen/WinEHPrepare.cpp2
-rw-r--r--llvm/lib/MC/MCDwarf.cpp2
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp2
-rw-r--r--llvm/lib/Target/AArch64/AArch64CollectLOH.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/StructurizeCFG.cpp2
-rw-r--r--llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp29
-rw-r--r--llvm/utils/TableGen/CodeGenRegisters.cpp2
8 files changed, 23 insertions, 20 deletions
diff --git a/llvm/lib/Analysis/RegionPass.cpp b/llvm/lib/Analysis/RegionPass.cpp
index cd1e944d46a..5e1cdd48a78 100644
--- a/llvm/lib/Analysis/RegionPass.cpp
+++ b/llvm/lib/Analysis/RegionPass.cpp
@@ -199,7 +199,7 @@ public:
bool runOnRegion(Region *R, RGPassManager &RGM) override {
Out << Banner;
- for (const auto &BB : R->blocks()) {
+ for (const auto *BB : R->blocks()) {
if (BB)
BB->print(Out);
else
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index e5e6f250d3e..afe26ff8224 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -909,7 +909,7 @@ bool WinEHPrepare::outlineHandler(ActionHandler *Action, Function *SrcFn,
// save the association of the blocks in LPadTargetBlocks. The
// return instructions which are created from these branches will be
// replaced after all landing pads have been outlined.
- for (const auto &MapEntry : VMap) {
+ for (const auto MapEntry : VMap) {
// VMap maps all values and blocks that were just cloned, but dead
// blocks which were pruned will map to nullptr.
if (!isa<BasicBlock>(MapEntry.first) || MapEntry.second == nullptr)
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 87e7ed17e32..e9f685eb88f 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -803,7 +803,7 @@ static void EmitGenDwarfRanges(MCStreamer *MCOS) {
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection());
- for (const auto sec : Sections) {
+ for (const auto &sec : Sections) {
MCSymbol *StartSymbol = sec.second.first;
MCSymbol *EndSymbol = sec.second.second;
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index ad278a449e8..4c38b8fd2b0 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -262,7 +262,7 @@ std::error_code COFFObjectFile::getSymbolSize(DataRefImpl Ref,
}
const section_iterator SecEnd = section_end();
uint64_t AfterAddr = UnknownAddressOrSize;
- for (const symbol_iterator &SymbI : symbols()) {
+ for (const symbol_iterator SymbI : symbols()) {
section_iterator SecI = SecEnd;
if (std::error_code EC = SymbI->getSection(SecI))
return EC;
diff --git a/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp b/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp
index 568f258c550..efdb2e33a36 100644
--- a/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp
+++ b/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp
@@ -328,7 +328,7 @@ static void initReachingDef(const MachineFunction &MF,
const uint32_t *PreservedRegs = MO.getRegMask();
// Set generated regs.
- for (const auto Entry : RegToId) {
+ for (const auto &Entry : RegToId) {
unsigned Reg = Entry.second;
// Use the global register ID when querying APIs external to this
// pass.
diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
index 6c3ce58c590..4f23e20d251 100644
--- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
+++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
@@ -887,7 +887,7 @@ void StructurizeCFG::createFlow() {
/// no longer dominate all their uses. Not sure if this is really nessasary
void StructurizeCFG::rebuildSSA() {
SSAUpdater Updater;
- for (const auto &BB : ParentRegion->blocks())
+ for (auto *BB : ParentRegion->blocks())
for (BasicBlock::iterator II = BB->begin(), IE = BB->end();
II != IE; ++II) {
diff --git a/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp b/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp
index aeb977a5b42..dacb48ab01f 100644
--- a/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp
+++ b/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp
@@ -355,7 +355,8 @@ static void dumpCXXData(const ObjectFile *Obj) {
StringRef SymName = VFTableEntry.second;
outs() << VFTableName << '[' << Offset << "]: " << SymName << '\n';
}
- for (const std::pair<StringRef, ArrayRef<little32_t>> &VBTable : VBTables) {
+ for (const std::pair<const StringRef, ArrayRef<little32_t>> &VBTable :
+ VBTables) {
StringRef VBTableName = VBTable.first;
uint32_t Idx = 0;
for (little32_t Offset : VBTable.second) {
@@ -363,7 +364,8 @@ static void dumpCXXData(const ObjectFile *Obj) {
Idx += sizeof(Offset);
}
}
- for (const std::pair<StringRef, CompleteObjectLocator> &COLPair : COLs) {
+ for (const std::pair<const StringRef, CompleteObjectLocator> &COLPair :
+ COLs) {
StringRef COLName = COLPair.first;
const CompleteObjectLocator &COL = COLPair.second;
outs() << COLName << "[IsImageRelative]: " << COL.Data[0] << '\n';
@@ -373,7 +375,8 @@ static void dumpCXXData(const ObjectFile *Obj) {
outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1]
<< '\n';
}
- for (const std::pair<StringRef, ClassHierarchyDescriptor> &CHDPair : CHDs) {
+ for (const std::pair<const StringRef, ClassHierarchyDescriptor> &CHDPair :
+ CHDs) {
StringRef CHDName = CHDPair.first;
const ClassHierarchyDescriptor &CHD = CHDPair.second;
outs() << CHDName << "[AlwaysZero]: " << CHD.Data[0] << '\n';
@@ -381,14 +384,14 @@ static void dumpCXXData(const ObjectFile *Obj) {
outs() << CHDName << "[NumClasses]: " << CHD.Data[2] << '\n';
outs() << CHDName << "[BaseClassArray]: " << CHD.Symbols[0] << '\n';
}
- for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &BCAEntry :
- BCAEntries) {
+ for (const std::pair<const std::pair<StringRef, uint64_t>, StringRef>
+ &BCAEntry : BCAEntries) {
StringRef BCAName = BCAEntry.first.first;
uint64_t Offset = BCAEntry.first.second;
StringRef SymName = BCAEntry.second;
outs() << BCAName << '[' << Offset << "]: " << SymName << '\n';
}
- for (const std::pair<StringRef, BaseClassDescriptor> &BCDPair : BCDs) {
+ for (const std::pair<const StringRef, BaseClassDescriptor> &BCDPair : BCDs) {
StringRef BCDName = BCDPair.first;
const BaseClassDescriptor &BCD = BCDPair.second;
outs() << BCDName << "[TypeDescriptor]: " << BCD.Symbols[0] << '\n';
@@ -400,7 +403,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1]
<< '\n';
}
- for (const std::pair<StringRef, TypeDescriptor> &TDPair : TDs) {
+ for (const std::pair<const StringRef, TypeDescriptor> &TDPair : TDs) {
StringRef TDName = TDPair.first;
const TypeDescriptor &TD = TDPair.second;
outs() << TDName << "[VFPtr]: " << TD.Symbols[0] << '\n';
@@ -410,7 +413,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
/*UseHexEscapes=*/true)
<< '\n';
}
- for (const std::pair<StringRef, ThrowInfo> &TIPair : TIs) {
+ for (const std::pair<const StringRef, ThrowInfo> &TIPair : TIs) {
StringRef TIName = TIPair.first;
const ThrowInfo &TI = TIPair.second;
auto dumpThrowInfoFlag = [&](const char *Name, uint32_t Flag) {
@@ -429,7 +432,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
dumpThrowInfoSymbol("ForwardCompat", 8);
dumpThrowInfoSymbol("CatchableTypeArray", 12);
}
- for (const std::pair<StringRef, CatchableTypeArray> &CTAPair : CTAs) {
+ for (const std::pair<const StringRef, CatchableTypeArray> &CTAPair : CTAs) {
StringRef CTAName = CTAPair.first;
const CatchableTypeArray &CTA = CTAPair.second;
@@ -441,7 +444,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
I != E; ++I)
outs() << CTAName << '[' << Idx++ << "]: " << I->second << '\n';
}
- for (const std::pair<StringRef, CatchableType> &CTPair : CTs) {
+ for (const std::pair<const StringRef, CatchableType> &CTPair : CTs) {
StringRef CTName = CTPair.first;
const CatchableType &CT = CTPair.second;
auto dumpCatchableTypeFlag = [&](const char *Name, uint32_t Flag) {
@@ -464,14 +467,14 @@ static void dumpCXXData(const ObjectFile *Obj) {
<< "[CopyCtor]: " << (CT.Symbols[1].empty() ? "null" : CT.Symbols[1])
<< '\n';
}
- for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &VTTPair :
- VTTEntries) {
+ for (const std::pair<const std::pair<StringRef, uint64_t>, StringRef>
+ &VTTPair : VTTEntries) {
StringRef VTTName = VTTPair.first.first;
uint64_t VTTOffset = VTTPair.first.second;
StringRef VTTEntry = VTTPair.second;
outs() << VTTName << '[' << VTTOffset << "]: " << VTTEntry << '\n';
}
- for (const std::pair<StringRef, StringRef> &TIPair : TINames) {
+ for (const std::pair<const StringRef, StringRef> &TIPair : TINames) {
StringRef TIName = TIPair.first;
outs() << TIName << ": " << TIPair.second << '\n';
}
diff --git a/llvm/utils/TableGen/CodeGenRegisters.cpp b/llvm/utils/TableGen/CodeGenRegisters.cpp
index e36066adf7a..4dd76813575 100644
--- a/llvm/utils/TableGen/CodeGenRegisters.cpp
+++ b/llvm/utils/TableGen/CodeGenRegisters.cpp
@@ -1780,7 +1780,7 @@ void CodeGenRegBank::computeRegUnitLaneMasks() {
const CodeGenRegister *SubRegister = S->second;
unsigned LaneMask = SubRegIndex->LaneMask;
// Distribute LaneMask to Register Units touched.
- for (const auto &SUI : SubRegister->getRegUnits()) {
+ for (unsigned SUI : SubRegister->getRegUnits()) {
bool Found = false;
unsigned u = 0;
for (unsigned RU : RegUnits) {
OpenPOWER on IntegriCloud