summaryrefslogtreecommitdiffstats
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-05-15 22:07:18 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-05-15 22:07:18 +0000
commit40d65dc3058e8d58426953d44e2ea0eccf996371 (patch)
tree74bf1db34c3c974ee7a5e6acaf8fa782bf9ea293 /tools/llvm-config
parent719daba3e01531c6947f07d351550e7ec0a3f0b9 (diff)
downloadexternal_llvm-40d65dc3058e8d58426953d44e2ea0eccf996371.zip
external_llvm-40d65dc3058e8d58426953d44e2ea0eccf996371.tar.gz
external_llvm-40d65dc3058e8d58426953d44e2ea0eccf996371.tar.bz2
llvm-config: Use sys::fs::equivalent instead of string comparison.
- Hopefully fixes PR11600 (untested). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/llvm-config.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 126542c..7edf5ec 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -190,9 +190,9 @@ int main(int argc, char **argv) {
sys::path::parent_path(CurrentPath)).str();
// Check to see if we are inside a development tree by comparing to possible
- // locations (prefix style or CMake style). This could be wrong in the face of
- // symbolic links, but is good enough.
- if (CurrentExecPrefix == std::string(LLVM_OBJ_ROOT) + "/" + LLVM_BUILDMODE) {
+ // locations (prefix style or CMake style).
+ if (sys::fs::equivalent(CurrentExecPrefix,
+ Twine(LLVM_OBJ_ROOT) + "/" + LLVM_BUILDMODE)) {
IsInDevelopmentTree = true;
DevelopmentTreeLayout = MakefileStyle;
@@ -204,11 +204,12 @@ int main(int argc, char **argv) {
} else {
ActiveObjRoot = LLVM_OBJ_ROOT;
}
- } else if (CurrentExecPrefix == std::string(LLVM_OBJ_ROOT)) {
+ } else if (sys::fs::equivalent(CurrentExecPrefix, LLVM_OBJ_ROOT)) {
IsInDevelopmentTree = true;
DevelopmentTreeLayout = CMakeStyle;
ActiveObjRoot = LLVM_OBJ_ROOT;
- } else if (CurrentExecPrefix == std::string(LLVM_OBJ_ROOT) + "/bin") {
+ } else if (sys::fs::equivalent(CurrentExecPrefix,
+ Twine(LLVM_OBJ_ROOT) + "/bin")) {
IsInDevelopmentTree = true;
DevelopmentTreeLayout = CMakeBuildModeStyle;
ActiveObjRoot = LLVM_OBJ_ROOT;