diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-12 15:07:11 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-12 15:07:11 +0000 |
commit | b703be2544d4bab1d7c86b463eb1518e5e811948 (patch) | |
tree | 5ee79a035b2772a4c95eb780acd501b5246a5e79 /llvm/lib/Support/Windows/Path.inc | |
parent | e3e790a46ecf71521b3115dcfc4c3c0c09e25990 (diff) | |
download | bcm5719-llvm-b703be2544d4bab1d7c86b463eb1518e5e811948.tar.gz bcm5719-llvm-b703be2544d4bab1d7c86b463eb1518e5e811948.zip |
Remove Path::getMagicNumber.
llvm-svn: 183839
Diffstat (limited to 'llvm/lib/Support/Windows/Path.inc')
-rw-r--r-- | llvm/lib/Support/Windows/Path.inc | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc index 165c18f0a53..4a6e56350b4 100644 --- a/llvm/lib/Support/Windows/Path.inc +++ b/llvm/lib/Support/Windows/Path.inc @@ -590,31 +590,6 @@ Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const { } } -bool Path::getMagicNumber(std::string& Magic, unsigned len) const { - assert(len < 1024 && "Request for magic string too long"); - char* buf = reinterpret_cast<char*>(alloca(len)); - - HANDLE h = CreateFile(path.c_str(), - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - if (h == INVALID_HANDLE_VALUE) - return false; - - DWORD nRead = 0; - BOOL ret = ReadFile(h, buf, len, &nRead, NULL); - CloseHandle(h); - - if (!ret || nRead != len) - return false; - - Magic = std::string(buf, len); - return true; -} - bool Path::renamePathOnDisk(const Path& newName, std::string* ErrMsg) { if (!MoveFileEx(path.c_str(), newName.c_str(), MOVEFILE_REPLACE_EXISTING)) |