Introduce a string_ostream string builder facilty
[oota-llvm.git] / lib / Support / YAMLTraits.cpp
index 0042c29036226b6908779a5c40edea2e3aa6f9da..5212624f0cd3f1f6b7a86c1e836b0ea84976631b 100644 (file)
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/Support/Errc.h"
 #include "llvm/Support/YAMLTraits.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/Casting.h"
@@ -18,7 +19,6 @@
 #include <cstring>
 using namespace llvm;
 using namespace yaml;
-using std::error_code;
 
 //===----------------------------------------------------------------------===//
 //  IO
@@ -57,9 +57,7 @@ Input::Input(StringRef InputContent,
 Input::~Input() {
 }
 
-error_code Input::error() {
-  return EC;
-}
+std::error_code Input::error() { return EC; }
 
 // Pin the vtables to this file.
 void Input::HNode::anchor() {}
@@ -75,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;
     }
 
@@ -125,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;
   }
 
@@ -301,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) {