summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/PathV2.inc
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-09 23:33:15 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-09 23:33:15 +0000
commit56b2ffdaba744d54eca958f5571de6e3fb6a427d (patch)
tree56f6e64fa2138c7e5972907d4bb5786e3abb099f /llvm/lib/Support/Unix/PathV2.inc
parent77ba1cf2868ac19d5a60b6a51c1775ede393f3b6 (diff)
downloadbcm5719-llvm-56b2ffdaba744d54eca958f5571de6e3fb6a427d.tar.gz
bcm5719-llvm-56b2ffdaba744d54eca958f5571de6e3fb6a427d.zip
Rip out realpath() support. It's expensive, and often a bad idea, and
I have another way to achieve the same goal. llvm-svn: 125239
Diffstat (limited to 'llvm/lib/Support/Unix/PathV2.inc')
-rw-r--r--llvm/lib/Support/Unix/PathV2.inc30
1 files changed, 0 insertions, 30 deletions
diff --git a/llvm/lib/Support/Unix/PathV2.inc b/llvm/lib/Support/Unix/PathV2.inc
index 3a3a438d05b..03ff28367e4 100644
--- a/llvm/lib/Support/Unix/PathV2.inc
+++ b/llvm/lib/Support/Unix/PathV2.inc
@@ -503,35 +503,5 @@ error_code get_magic(const Twine &path, uint32_t len,
}
} // end namespace fs
-
-namespace path {
-
-void canonical(const char *path, SmallVectorImpl<char> &buffer) {
- buffer.resize(PATH_MAX);
- char *result = realpath(path, buffer.data());
- if (result) {
- buffer.resize(strlen(result));
- return;
- }
-
- // A common extension is to support memory allocation of the result when
- // passing NULL as the second argument.
- result = realpath(path, 0);
- if (result) {
- size_t length = strlen(result);
- buffer.resize(length);
- memcpy(buffer.data(), result, length);
- free(result);
- return;
- }
-
- size_t length = strlen(path);
- buffer.resize(length);
- memcpy(buffer.data(), path, length);
- return;
-}
-
-} // end namespace path
-
} // end namespace sys
} // end namespace llvm
OpenPOWER on IntegriCloud