summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-11 18:05:19 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-11 18:05:19 +0000
commit250ab1dc0eac879b8a2fdeab23c34c79c59bef50 (patch)
tree4f57c9a41d9b9f95a7bae48aaccecc9acbdd0e86 /clang/lib/Frontend/ASTUnit.cpp
parente10f0e5670e1440e37b826654afb5c61a113f2ac (diff)
downloadbcm5719-llvm-250ab1dc0eac879b8a2fdeab23c34c79c59bef50.tar.gz
bcm5719-llvm-250ab1dc0eac879b8a2fdeab23c34c79c59bef50.zip
The two libclang crash-recovery tests that involve precompiled
preambles end up leaving the precompiled preambles around. This is by design, since we do minimal cleanup during crash recovery. However, it's unfortunate for testing, so introduce a hook that allows these two tests to put the precompiled preamble somewhere where we can delete them after testing. llvm-svn: 113698
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 4cbb2a3f13a..c203ffa9352 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -803,6 +803,13 @@ static std::string GetPreamblePCHPath() {
// FIXME: This is lame; sys::Path should provide this function (in particular,
// it should know how to find the temporary files dir).
// FIXME: This is really lame. I copied this code from the Driver!
+ // FIXME: This is a hack so that we can override the preamble file during
+ // crash-recovery testing, which is the only case where the preamble files
+ // are not necessarily cleaned up.
+ const char *TmpFile = ::getenv("CINDEXTEST_PREAMBLE_FILE");
+ if (TmpFile)
+ return TmpFile;
+
std::string Error;
const char *TmpDir = ::getenv("TMPDIR");
if (!TmpDir)
OpenPOWER on IntegriCloud