summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-02-09 19:23:08 +0000
committerBen Langmuir <blangmuir@apple.com>2015-02-09 19:23:08 +0000
commitd072eea5d605b4782c9827f5bf8903fa86bd6e5a (patch)
tree34f78226e86831bdc85fc298f8299909b38254bb /clang/lib/Frontend/CompilerInvocation.cpp
parent38b2591469543c30e28e1d49740d42ad7cfba0ba (diff)
downloadbcm5719-llvm-d072eea5d605b4782c9827f5bf8903fa86bd6e5a.tar.gz
bcm5719-llvm-d072eea5d605b4782c9827f5bf8903fa86bd6e5a.zip
Add the hostname to the module hash to avoid sharing between hosts
Sharing between hosts will cause problems for the LockFileManager, which can timeout waiting for a process that has already died. llvm-svn: 228592
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index f8d71acd329..eef0535265f 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2021,6 +2021,16 @@ std::string CompilerInvocation::getModuleHash() const {
}
}
+#if LLVM_ON_UNIX
+ // The LockFileManager cannot tell when processes from another host are
+ // running, so mangle the hostname in to the module hash to separate them.
+ char hostname[256];
+ hostname[255] = 0;
+ hostname[0] = 0;
+ gethostname(hostname, 255);
+ code = hash_combine(code, StringRef(hostname));
+#endif
+
return llvm::APInt(64, code).toString(36, /*Signed=*/false);
}
OpenPOWER on IntegriCloud