[llvm] r210772 - Don't import make_error_code into the llvm namespace.
Rafael Espindola
rafael.espindola at gmail.com
Thu Jun 12 04:58:49 PDT 2014
Author: rafael
Date: Thu Jun 12 06:58:49 2014
New Revision: 210772
URL: http://llvm.org/viewvc/llvm-project?rev=210772&view=rev
Log:
Don't import make_error_code into the llvm namespace.
Modified:
llvm/trunk/include/llvm/Support/ErrorOr.h
llvm/trunk/include/llvm/Support/system_error.h
llvm/trunk/lib/Support/FileOutputBuffer.cpp
llvm/trunk/lib/Support/LockFileManager.cpp
llvm/trunk/lib/Support/MemoryBuffer.cpp
llvm/trunk/lib/Support/Windows/Path.inc
llvm/trunk/lib/Support/YAMLTraits.cpp
llvm/trunk/tools/llvm-ar/llvm-ar.cpp
Modified: llvm/trunk/include/llvm/Support/ErrorOr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ErrorOr.h?rev=210772&r1=210771&r2=210772&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/ErrorOr.h (original)
+++ llvm/trunk/include/llvm/Support/ErrorOr.h Thu Jun 12 06:58:49 2014
@@ -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));
}
Modified: llvm/trunk/include/llvm/Support/system_error.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/system_error.h?rev=210772&r1=210771&r2=210772&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/system_error.h (original)
+++ llvm/trunk/include/llvm/Support/system_error.h Thu Jun 12 06:58:49 2014
@@ -18,7 +18,6 @@
namespace llvm {
using std::error_code;
-using std::make_error_code;
}
#endif
Modified: llvm/trunk/lib/Support/FileOutputBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileOutputBuffer.cpp?rev=210772&r1=210771&r2=210772&view=diff
==============================================================================
--- llvm/trunk/lib/Support/FileOutputBuffer.cpp (original)
+++ llvm/trunk/lib/Support/FileOutputBuffer.cpp Thu Jun 12 06:58:49 2014
@@ -51,7 +51,7 @@ error_code FileOutputBuffer::create(Stri
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.
Modified: llvm/trunk/lib/Support/LockFileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/LockFileManager.cpp?rev=210772&r1=210771&r2=210772&view=diff
==============================================================================
--- llvm/trunk/lib/Support/LockFileManager.cpp (original)
+++ llvm/trunk/lib/Support/LockFileManager.cpp Thu Jun 12 06:58:49 2014
@@ -114,7 +114,7 @@ LockFileManager::LockFileManager(StringR
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;
}
Modified: llvm/trunk/lib/Support/MemoryBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MemoryBuffer.cpp?rev=210772&r1=210771&r2=210772&view=diff
==============================================================================
--- llvm/trunk/lib/Support/MemoryBuffer.cpp (original)
+++ llvm/trunk/lib/Support/MemoryBuffer.cpp Thu Jun 12 06:58:49 2014
@@ -361,7 +361,7 @@ static error_code getOpenFileImpl(int FD
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);
Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=210772&r1=210771&r2=210772&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Thu Jun 12 06:58:49 2014
@@ -475,7 +475,7 @@ error_code mapped_file_region::init(int
_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(i
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 &
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
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;
}
Modified: llvm/trunk/lib/Support/YAMLTraits.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLTraits.cpp?rev=210772&r1=210771&r2=210772&view=diff
==============================================================================
--- llvm/trunk/lib/Support/YAMLTraits.cpp (original)
+++ llvm/trunk/lib/Support/YAMLTraits.cpp Thu Jun 12 06:58:49 2014
@@ -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
// 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
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) {
Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=210772&r1=210771&r2=210772&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Thu Jun 12 06:58:49 2014
@@ -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;
}
More information about the llvm-commits
mailing list