diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-11 21:53:22 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-11 21:53:22 +0000 |
commit | 70fbe6f80e5836377f8b50098aa869e962ccf41a (patch) | |
tree | 4084bc3af20a1f336c260dfb949f4553c14a8665 /llvm/lib | |
parent | e05d38048682ad46e7b89b115872fc84043c20d4 (diff) | |
download | bcm5719-llvm-70fbe6f80e5836377f8b50098aa869e962ccf41a.tar.gz bcm5719-llvm-70fbe6f80e5836377f8b50098aa869e962ccf41a.zip |
Remove unused has_magic.
This will allow inlining get_magic, which should in turn fix one of the mingw
build problems after the switch to std::error_code.
llvm-svn: 210712
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index a9ac88e5d39..c063bed2b50 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -890,24 +890,6 @@ void directory_entry::replace_filename(const Twine &filename, file_status st) { Status = st; } -error_code has_magic(const Twine &path, const Twine &magic, bool &result) { - SmallString<32> MagicStorage; - StringRef Magic = magic.toStringRef(MagicStorage); - SmallString<32> Buffer; - - if (error_code ec = get_magic(path, Magic.size(), Buffer)) { - if (ec == std::errc::value_too_large) { - // Magic.size() > file_size(Path). - result = false; - return error_code(); - } - return ec; - } - - result = Magic == Buffer; - return error_code(); -} - /// @brief Identify the magic in magic. file_magic identify_magic(StringRef Magic) { if (Magic.size() < 4) |