summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-08 22:00:09 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-08 22:00:09 +0000
commitd28918b28996051a156f4ee0c11c884ea3cbcdc9 (patch)
tree578350222de8187727fd44d68fa3de7f0f5dcea1 /lld/lib/Core
parent98f3de8880d4d387135b1a8407ba82d212b00862 (diff)
downloadbcm5719-llvm-d28918b28996051a156f4ee0c11c884ea3cbcdc9.tar.gz
bcm5719-llvm-d28918b28996051a156f4ee0c11c884ea3cbcdc9.zip
Use getError instead of the error_code operator.
llvm-svn: 198797
Diffstat (limited to 'lld/lib/Core')
-rw-r--r--lld/lib/Core/InputGraph.cpp2
-rw-r--r--lld/lib/Core/LinkingContext.cpp6
-rw-r--r--lld/lib/Core/Resolver.cpp5
3 files changed, 7 insertions, 6 deletions
diff --git a/lld/lib/Core/InputGraph.cpp b/lld/lib/Core/InputGraph.cpp
index db77eb367e3..24dfbb532ac 100644
--- a/lld/lib/Core/InputGraph.cpp
+++ b/lld/lib/Core/InputGraph.cpp
@@ -202,7 +202,7 @@ ErrorOr<File &> Group::getNextFile() {
auto file = _elements[_nextElementIndex]->getNextFile();
// Move on to the next element if we have finished processing all
// the files in the input element
- if (error_code(file) == InputGraphError::no_more_files) {
+ if (file.getError() == InputGraphError::no_more_files) {
_nextElementIndex++;
continue;
}
diff --git a/lld/lib/Core/LinkingContext.cpp b/lld/lib/Core/LinkingContext.cpp
index 8a1ef257df1..5cb370a18bd 100644
--- a/lld/lib/Core/LinkingContext.cpp
+++ b/lld/lib/Core/LinkingContext.cpp
@@ -91,7 +91,7 @@ ErrorOr<File &> LinkingContext::nextFile() {
// initialized. Initialize it with the first element of the input graph.
if (_currentInputElement == nullptr) {
ErrorOr<InputElement *> elem = inputGraph().getNextInputElement();
- if (error_code(elem) == InputGraphError::no_more_elements)
+ if (elem.getError() == InputGraphError::no_more_elements)
return make_error_code(InputGraphError::no_more_files);
_currentInputElement = *elem;
}
@@ -102,11 +102,11 @@ ErrorOr<File &> LinkingContext::nextFile() {
// graph.
for (;;) {
ErrorOr<File &> nextFile = _currentInputElement->getNextFile();
- if (error_code(nextFile) != InputGraphError::no_more_files)
+ if (nextFile.getError() != InputGraphError::no_more_files)
return std::move(nextFile);
ErrorOr<InputElement *> elem = inputGraph().getNextInputElement();
- if (error_code(elem) == InputGraphError::no_more_elements ||
+ if (elem.getError() == InputGraphError::no_more_elements ||
*elem == nullptr)
return make_error_code(InputGraphError::no_more_files);
_currentInputElement = *elem;
diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp
index a889ee047cd..4673e77556b 100644
--- a/lld/lib/Core/Resolver.cpp
+++ b/lld/lib/Core/Resolver.cpp
@@ -266,11 +266,12 @@ bool Resolver::resolveUndefines() {
for (;;) {
ErrorOr<File &> file = _context.nextFile();
_context.setResolverState(Resolver::StateNoChange);
- if (error_code(file) == InputGraphError::no_more_files)
+ error_code ec = file.getError();
+ if (ec == InputGraphError::no_more_files)
return true;
if (!file) {
llvm::errs() << "Error occurred in nextFile: "
- << error_code(file).message() << "\n";
+ << ec.message() << "\n";
return false;
}
OpenPOWER on IntegriCloud