summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/ErrorOr.h1
-rw-r--r--include/llvm/Support/system_error.h1
-rw-r--r--lib/Support/FileOutputBuffer.cpp2
-rw-r--r--lib/Support/LockFileManager.cpp2
-rw-r--r--lib/Support/MemoryBuffer.cpp2
-rw-r--r--lib/Support/Windows/Path.inc8
-rw-r--r--lib/Support/YAMLTraits.cpp6
-rw-r--r--tools/llvm-ar/llvm-ar.cpp2
8 files changed, 12 insertions, 12 deletions
diff --git a/include/llvm/Support/ErrorOr.h b/include/llvm/Support/ErrorOr.h
index e877b6ab9d..d2a316fbf4 100644
--- a/include/llvm/Support/ErrorOr.h
+++ b/include/llvm/Support/ErrorOr.h
@@ -99,6 +99,7 @@ public:
std::is_error_condition_enum<E>::value,
void *>::type = 0)
: HasError(true) {
+ using std::make_error_code;
new (getErrorStorage()) error_code(make_error_code(ErrorCode));
}
diff --git a/include/llvm/Support/system_error.h b/include/llvm/Support/system_error.h
index 84b9e2b85a..1b48ba935e 100644
--- a/include/llvm/Support/system_error.h
+++ b/include/llvm/Support/system_error.h
@@ -18,7 +18,6 @@
namespace llvm {
using std::error_code;
-using std::make_error_code;
}
#endif
diff --git a/lib/Support/FileOutputBuffer.cpp b/lib/Support/FileOutputBuffer.cpp
index b869054338..c8ed1ddef6 100644
--- a/lib/Support/FileOutputBuffer.cpp
+++ b/lib/Support/FileOutputBuffer.cpp
@@ -51,7 +51,7 @@ error_code FileOutputBuffer::create(StringRef FilePath,
if (EC)
return EC;
else
- return make_error_code(std::errc::operation_not_permitted);
+ return std::make_error_code(std::errc::operation_not_permitted);
}
// Delete target file.
diff --git a/lib/Support/LockFileManager.cpp b/lib/Support/LockFileManager.cpp
index 2b7fc812d5..b050e5de8d 100644
--- a/lib/Support/LockFileManager.cpp
+++ b/lib/Support/LockFileManager.cpp
@@ -114,7 +114,7 @@ LockFileManager::LockFileManager(StringRef FileName)
if (Out.has_error()) {
// We failed to write out PID, so make up an excuse, remove the
// unique lock file, and fail.
- Error = make_error_code(std::errc::no_space_on_device);
+ Error = std::make_error_code(std::errc::no_space_on_device);
sys::fs::remove(UniqueLockFileName.c_str());
return;
}
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index b1ebbf8e4f..ab554cbfd5 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/lib/Support/MemoryBuffer.cpp
@@ -361,7 +361,7 @@ static error_code getOpenFileImpl(int FD, const char *Filename,
if (!Buf) {
// Failed to create a buffer. The only way it can fail is if
// new(std::nothrow) returns 0.
- return make_error_code(std::errc::not_enough_memory);
+ return std::make_error_code(std::errc::not_enough_memory);
}
std::unique_ptr<MemoryBuffer> SB(Buf);
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc
index 662f3019de..a26d9e89e6 100644
--- a/lib/Support/Windows/Path.inc
+++ b/lib/Support/Windows/Path.inc
@@ -475,7 +475,7 @@ error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) {
_close(FileDescriptor);
} else
::CloseHandle(FileHandle);
- return make_error_code(std::errc::invalid_argument);
+ return std::make_error_code(std::errc::invalid_argument);
}
DWORD flprotect;
@@ -611,7 +611,7 @@ mapped_file_region::mapped_file_region(int fd,
if (closefd)
_close(FileDescriptor);
FileDescriptor = 0;
- ec = make_error_code(std::errc::bad_file_descriptor);
+ ec = std::make_error_code(std::errc::bad_file_descriptor);
return;
}
@@ -774,7 +774,7 @@ error_code openFileForRead(const Twine &Name, int &ResultFD) {
if (LastError != ERROR_ACCESS_DENIED)
return EC;
if (is_directory(Name))
- return make_error_code(std::errc::is_a_directory);
+ return std::make_error_code(std::errc::is_a_directory);
return EC;
}
@@ -826,7 +826,7 @@ error_code openFileForWrite(const Twine &Name, int &ResultFD,
if (LastError != ERROR_ACCESS_DENIED)
return EC;
if (is_directory(Name))
- return make_error_code(std::errc::is_a_directory);
+ return std::make_error_code(std::errc::is_a_directory);
return EC;
}
diff --git a/lib/Support/YAMLTraits.cpp b/lib/Support/YAMLTraits.cpp
index ed80eac76a..66af33693d 100644
--- a/lib/Support/YAMLTraits.cpp
+++ b/lib/Support/YAMLTraits.cpp
@@ -74,7 +74,7 @@ bool Input::setCurrentDocument() {
Node *N = DocIterator->getRoot();
if (!N) {
assert(Strm->failed() && "Root is NULL iff parsing failed");
- EC = make_error_code(std::errc::invalid_argument);
+ EC = std::make_error_code(std::errc::invalid_argument);
return false;
}
@@ -124,7 +124,7 @@ bool Input::preflightKey(const char *Key, bool Required, bool, bool &UseDefault,
// nodes are present.
if (!CurrentNode) {
if (Required)
- EC = make_error_code(std::errc::invalid_argument);
+ EC = std::make_error_code(std::errc::invalid_argument);
return false;
}
@@ -300,7 +300,7 @@ void Input::setError(HNode *hnode, const Twine &message) {
void Input::setError(Node *node, const Twine &message) {
Strm->printError(node, message);
- EC = make_error_code(std::errc::invalid_argument);
+ EC = std::make_error_code(std::errc::invalid_argument);
}
Input::HNode *Input::createHNodes(Node *N) {
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index 77914c5792..47e8d8de16 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/tools/llvm-ar/llvm-ar.cpp
@@ -453,7 +453,7 @@ int NewArchiveIterator::getFD() const {
// Linux cannot open directories with open(2), although
// cygwin and *bsd can.
if (NewStatus.type() == sys::fs::file_type::directory_file)
- failIfError(make_error_code(std::errc::is_a_directory), NewFilename);
+ failIfError(std::make_error_code(std::errc::is_a_directory), NewFilename);
return NewFD;
}