diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-13 17:23:04 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-13 17:23:04 +0000 |
| commit | 74f293249d9e60e3631fc8b08148ef3d8a4df72d (patch) | |
| tree | 8d85e53c7147f1a63ef6acee449d99283dedf5b9 /llvm/lib/Support/Windows | |
| parent | d3f64274462e500724ae2df9d7b590094eff87b4 (diff) | |
| download | bcm5719-llvm-74f293249d9e60e3631fc8b08148ef3d8a4df72d.tar.gz bcm5719-llvm-74f293249d9e60e3631fc8b08148ef3d8a4df72d.zip | |
Don't use std::errc.
As noted on Errc.h:
// * std::errc is just marked with is_error_condition_enum. This means that
// common patters like AnErrorCode == errc::no_such_file_or_directory take
// 4 virtual calls instead of two comparisons.
And on some libstdc++ those virtual functions conclude that
------------------------
int main() {
std::error_code foo = std::make_error_code(std::errc::no_such_file_or_directory);
return foo == std::errc::no_such_file_or_directory;
}
-------------------------
should exit with 0.
llvm-svn: 239683
Diffstat (limited to 'llvm/lib/Support/Windows')
| -rw-r--r-- | llvm/lib/Support/Windows/Program.inc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Windows/Program.inc b/llvm/lib/Support/Windows/Program.inc index 75685de4554..c29d8729b1d 100644 --- a/llvm/lib/Support/Windows/Program.inc +++ b/llvm/lib/Support/Windows/Program.inc @@ -14,6 +14,7 @@ #include "WindowsSupport.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/ConvertUTF.h" +#include "llvm/Support/Errc.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/WindowsError.h" #include "llvm/Support/raw_ostream.h" @@ -514,7 +515,7 @@ llvm::sys::writeFileWithEncoding(StringRef FileName, StringRef Contents, } if (OS.has_error()) - return std::make_error_code(std::errc::io_error); + return make_error_code(errc::io_error); return EC; } |

