summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-30 02:49:58 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-30 02:49:58 +0000
commit8fe1f37c55b0cb5e96fd47dd9396185378a49f24 (patch)
tree5c4b3cbaabb84e99ebbea489c1b79575434f4d9f
parent5e812afaeb3db56db706e81e448db46c08298abd (diff)
downloadbcm5719-llvm-8fe1f37c55b0cb5e96fd47dd9396185378a49f24.tar.gz
bcm5719-llvm-8fe1f37c55b0cb5e96fd47dd9396185378a49f24.zip
Update for llvm api change.
llvm-svn: 200443
-rw-r--r--lld/lib/ReaderWriter/FileArchive.cpp6
-rw-r--r--lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp16
2 files changed, 9 insertions, 13 deletions
diff --git a/lld/lib/ReaderWriter/FileArchive.cpp b/lld/lib/ReaderWriter/FileArchive.cpp
index d54a82d0f2c..4213cb2e0bb 100644
--- a/lld/lib/ReaderWriter/FileArchive.cpp
+++ b/lld/lib/ReaderWriter/FileArchive.cpp
@@ -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))))
diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
index 81c733950de..c437ac5ac31 100644
--- a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
@@ -527,9 +527,8 @@ error_code FileCOFF::cacheSectionAttributes() {
// 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(Reference::KindArch &result) {
/// 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::addRelocationReferenceToAtoms() {
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::addRelocationReferenceToAtoms() {
/// 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;
OpenPOWER on IntegriCloud