[lld] r200443 - Update for llvm api change.
Rafael Espindola
rafael.espindola at gmail.com
Wed Jan 29 18:49:58 PST 2014
Author: rafael
Date: Wed Jan 29 20:49:58 2014
New Revision: 200443
URL: http://llvm.org/viewvc/llvm-project?rev=200443&view=rev
Log:
Update for llvm api change.
Modified:
lld/trunk/lib/ReaderWriter/FileArchive.cpp
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
Modified: lld/trunk/lib/ReaderWriter/FileArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/FileArchive.cpp?rev=200443&r1=200442&r2=200443&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/FileArchive.cpp (original)
+++ lld/trunk/lib/ReaderWriter/FileArchive.cpp Wed Jan 29 20:49:58 2014
@@ -117,16 +117,14 @@ protected:
if (auto ec = objOrErr.getError())
return ec;
std::unique_ptr<ObjectFile> obj(objOrErr.get());
- error_code ec;
SymbolRef::Type symtype;
uint32_t symflags;
symbol_iterator ibegin = obj->begin_symbols();
symbol_iterator iend = obj->end_symbols();
StringRef symbolname;
- for (symbol_iterator i = ibegin; i != iend; i.increment(ec)) {
- if (ec)
- return ec;
+ for (symbol_iterator i = ibegin; i != iend; ++i) {
+ error_code ec;
// Get symbol name
if ((ec = (i->getName(symbolname))))
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=200443&r1=200442&r2=200443&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Wed Jan 29 20:49:58 2014
@@ -527,9 +527,8 @@ error_code FileCOFF::cacheSectionAttribu
// The sections that does not have auxiliary symbol are regular sections, in
// which symbols are not allowed to be merged.
- error_code ec;
for (auto si = _obj->begin_sections(), se = _obj->end_sections(); si != se;
- si.increment(ec)) {
+ ++si) {
const coff_section *sec = _obj->getCOFFSection(si);
if (!_merge.count(sec))
_merge[sec] = DefinedAtom::mergeNo;
@@ -745,9 +744,8 @@ error_code FileCOFF::getReferenceArch(Re
/// Add relocation information to atoms.
error_code FileCOFF::addRelocationReferenceToAtoms() {
// Relocation entries are defined for each section.
- error_code ec;
for (auto si = _obj->begin_sections(), se = _obj->end_sections(); si != se;
- si.increment(ec)) {
+ ++si) {
const coff_section *section = _obj->getCOFFSection(si);
// Skip there's no atom for the section. Currently we do not create any
@@ -757,9 +755,10 @@ error_code FileCOFF::addRelocationRefere
continue;
for (auto ri = si->begin_relocations(), re = si->end_relocations();
- ri != re; ri.increment(ec)) {
+ ri != re; ++ri) {
const coff_relocation *rel = _obj->getCOFFRelocation(ri);
- if ((ec = addRelocationReference(rel, section, _sectionAtoms[section])))
+ if (auto ec =
+ addRelocationReference(rel, section, _sectionAtoms[section]))
return ec;
}
}
@@ -768,12 +767,11 @@ error_code FileCOFF::addRelocationRefere
/// Find a section by name.
error_code FileCOFF::findSection(StringRef name, const coff_section *&result) {
- error_code ec;
for (auto si = _obj->begin_sections(), se = _obj->end_sections(); si != se;
- si.increment(ec)) {
+ ++si) {
const coff_section *section = _obj->getCOFFSection(si);
StringRef sectionName;
- if ((ec = _obj->getSectionName(section, sectionName)))
+ if (auto ec = _obj->getSectionName(section, sectionName))
return ec;
if (sectionName == name) {
result = section;
More information about the llvm-commits
mailing list