[llvm-commits] CVS: llvm/lib/System/Unix/Path.inc
Chris Lattner
sabre at nondot.org
Sat May 5 22:32:44 PDT 2007
Changes in directory llvm/lib/System/Unix:
Path.inc updated: 1.62 -> 1.63
---
Log message:
pull some win32 code into common code, add bitcode identification support.
---
Diffs of the changes: (+0 -31)
Path.inc | 31 -------------------------------
1 files changed, 31 deletions(-)
Index: llvm/lib/System/Unix/Path.inc
diff -u llvm/lib/System/Unix/Path.inc:1.62 llvm/lib/System/Unix/Path.inc:1.63
--- llvm/lib/System/Unix/Path.inc:1.62 Sat Apr 7 13:52:17 2007
+++ llvm/lib/System/Unix/Path.inc Sun May 6 00:32:21 2007
@@ -267,21 +267,6 @@
return path.substr(slash, dot - slash);
}
-bool Path::hasMagicNumber(const std::string &Magic) const {
- size_t len = Magic.size();
- assert(len < 1024 && "Request for magic string too long");
- char* buf = (char*) alloca(1 + len);
- int fd = ::open(path.c_str(), O_RDONLY);
- if (fd < 0)
- return false;
- size_t read_len = ::read(fd, buf, len);
- close(fd);
- if (len != read_len)
- return false;
- buf[len] = '\0';
- return Magic == buf;
-}
-
bool Path::getMagicNumber(std::string& Magic, unsigned len) const {
assert(len < 1024 && "Request for magic string too long");
char* buf = (char*) alloca(1 + len);
@@ -298,22 +283,6 @@
return true;
}
-bool
-Path::isBytecodeFile() const {
- char buffer[4];
- buffer[0] = 0;
- int fd = ::open(path.c_str(), O_RDONLY);
- if (fd < 0)
- return false;
- ssize_t bytes_read = ::read(fd, buffer, 4);
- ::close(fd);
- if (4 != bytes_read)
- return false;
-
- return (buffer[0] == 'l' && buffer[1] == 'l' && buffer[2] == 'v' &&
- (buffer[3] == 'c' || buffer[3] == 'm'));
-}
-
bool
Path::exists() const {
return 0 == access(path.c_str(), F_OK );
More information about the llvm-commits
mailing list