diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-12-11 17:17:26 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-12-11 17:17:26 +0000 |
commit | 71bc507c4fae62e45606a5d3341f2913039b22e1 (patch) | |
tree | 7191a021bd9ed78f946072b860ea87ddbad59b6d /llvm/lib/Support/Unix/Path.inc | |
parent | 5fb084e7980689486396dcc0c2d72b593b5065b9 (diff) | |
download | llvm-71bc507c4fae62e45606a5d3341f2913039b22e1.zip llvm-71bc507c4fae62e45606a5d3341f2913039b22e1.tar.gz llvm-71bc507c4fae62e45606a5d3341f2913039b22e1.tar.bz2 |
Remove dead code. NFC.
llvm-svn: 224029
Diffstat (limited to 'llvm/lib/Support/Unix/Path.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 82b207e..72ef83c 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -470,34 +470,6 @@ std::error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) return std::error_code(); } -mapped_file_region::mapped_file_region(const Twine &path, - mapmode mode, - uint64_t length, - uint64_t offset, - std::error_code &ec) - : Mode(mode) - , Size(length) - , Mapping() { - // Make sure that the requested size fits within SIZE_T. - if (length > std::numeric_limits<size_t>::max()) { - ec = make_error_code(errc::invalid_argument); - return; - } - - SmallString<128> path_storage; - StringRef name = path.toNullTerminatedStringRef(path_storage); - int oflags = (mode == readonly) ? O_RDONLY : O_RDWR; - int ofd = ::open(name.begin(), oflags); - if (ofd == -1) { - ec = std::error_code(errno, std::generic_category()); - return; - } - - ec = init(ofd, true, offset); - if (ec) - Mapping = nullptr; -} - mapped_file_region::mapped_file_region(int fd, bool closefd, mapmode mode, @@ -528,11 +500,6 @@ mapped_file_region::mapped_file_region(mapped_file_region &&other) other.Mapping = nullptr; } -mapped_file_region::mapmode mapped_file_region::flags() const { - assert(Mapping && "Mapping failed but used anyway!"); - return Mode; -} - uint64_t mapped_file_region::size() const { assert(Mapping && "Mapping failed but used anyway!"); return Size; |