summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/YAMLTraits.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-13 17:20:48 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-13 17:20:48 +0000
commit2a826e40fa51fcae4adb564d789cafe95776e0bb (patch)
treefc0dea973c66e8777a6354c1e01199057d38b023 /llvm/lib/Support/YAMLTraits.cpp
parent372bc70c639a45e69a519a2e47f0b9a06e23914a (diff)
downloadbcm5719-llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.tar.gz
bcm5719-llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.zip
Finishing touch for the std::error_code transition.
While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration. This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code. llvm-svn: 210920
Diffstat (limited to 'llvm/lib/Support/YAMLTraits.cpp')
-rw-r--r--llvm/lib/Support/YAMLTraits.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
index 0bf9cf89088..5212624f0cd 100644
--- a/llvm/lib/Support/YAMLTraits.cpp
+++ b/llvm/lib/Support/YAMLTraits.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Support/Errc.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Casting.h"
@@ -72,7 +73,7 @@ bool Input::setCurrentDocument() {
Node *N = DocIterator->getRoot();
if (!N) {
assert(Strm->failed() && "Root is NULL iff parsing failed");
- EC = std::make_error_code(std::errc::invalid_argument);
+ EC = make_error_code(errc::invalid_argument);
return false;
}
@@ -122,7 +123,7 @@ bool Input::preflightKey(const char *Key, bool Required, bool, bool &UseDefault,
// nodes are present.
if (!CurrentNode) {
if (Required)
- EC = std::make_error_code(std::errc::invalid_argument);
+ EC = make_error_code(errc::invalid_argument);
return false;
}
@@ -298,7 +299,7 @@ void Input::setError(HNode *hnode, const Twine &message) {
void Input::setError(Node *node, const Twine &message) {
Strm->printError(node, message);
- EC = std::make_error_code(std::errc::invalid_argument);
+ EC = make_error_code(errc::invalid_argument);
}
Input::HNode *Input::createHNodes(Node *N) {
OpenPOWER on IntegriCloud