diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-13 17:20:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-13 17:20:48 +0000 |
commit | 2a826e40fa51fcae4adb564d789cafe95776e0bb (patch) | |
tree | fc0dea973c66e8777a6354c1e01199057d38b023 /llvm/lib/Support/MemoryBuffer.cpp | |
parent | 372bc70c639a45e69a519a2e47f0b9a06e23914a (diff) | |
download | bcm5719-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/MemoryBuffer.cpp')
-rw-r--r-- | llvm/lib/Support/MemoryBuffer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index 8ff4e7c4dc3..abf4f60b27a 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -14,6 +14,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/ADT/SmallString.h" #include "llvm/Config/config.h" +#include "llvm/Support/Errc.h" #include "llvm/Support/Errno.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MathExtras.h" @@ -364,7 +365,7 @@ static std::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 std::make_error_code(std::errc::not_enough_memory); + return make_error_code(errc::not_enough_memory); } std::unique_ptr<MemoryBuffer> SB(Buf); |