aboutsummaryrefslogtreecommitdiff
path: root/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
commit424668cc90a07f3f98b36dad252940a43ded83d8 (patch)
treeedbf080caac4b804c21a94aa41f304c2118ca52e /lib/Frontend/ASTUnit.cpp
parent2cd4fd4b7554480cbea67b48de5e5d467d06e292 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113698 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 4cbb2a3f13..c203ffa935 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/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)