summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2019-11-27 13:44:06 +0100
committerSam McCall <sam.mccall@gmail.com>2019-11-27 13:44:14 +0100
commit3edf2eb897e4fe0795253e8e8c1e62b93bac60c9 (patch)
tree0a38f736e239617e0db899c6aa9d43b61d913400 /clang/lib/Frontend
parent9872ea4ed1de4c49300430e4f1f4dfc110a79ab9 (diff)
downloadbcm5719-llvm-3edf2eb897e4fe0795253e8e8c1e62b93bac60c9.tar.gz
bcm5719-llvm-3edf2eb897e4fe0795253e8e8c1e62b93bac60c9.zip
[Frontend] Clean up some dead code in PrecompiledPreamble. NFC
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/PrecompiledPreamble.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/clang/lib/Frontend/PrecompiledPreamble.cpp b/clang/lib/Frontend/PrecompiledPreamble.cpp
index ced32c67028..0e5a8e504dc 100644
--- a/clang/lib/Frontend/PrecompiledPreamble.cpp
+++ b/clang/lib/Frontend/PrecompiledPreamble.cpp
@@ -535,21 +535,15 @@ PrecompiledPreamble::TempPCHFile::CreateNewPreamblePCHFile() {
// 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 TempPCHFile::createFromCustomPath(TmpFile);
- return TempPCHFile::createInSystemTempDir("preamble", "pch");
-}
+ if (const char *TmpFile = ::getenv("CINDEXTEST_PREAMBLE_FILE"))
+ return TempPCHFile(TmpFile);
-llvm::ErrorOr<PrecompiledPreamble::TempPCHFile>
-PrecompiledPreamble::TempPCHFile::createInSystemTempDir(const Twine &Prefix,
- StringRef Suffix) {
llvm::SmallString<64> File;
// Using a version of createTemporaryFile with a file descriptor guarantees
// that we would never get a race condition in a multi-threaded setting
// (i.e., multiple threads getting the same temporary path).
int FD;
- auto EC = llvm::sys::fs::createTemporaryFile(Prefix, Suffix, FD, File);
+ auto EC = llvm::sys::fs::createTemporaryFile("preamble", "pch", FD, File);
if (EC)
return EC;
// We only needed to make sure the file exists, close the file right away.
@@ -557,11 +551,6 @@ PrecompiledPreamble::TempPCHFile::createInSystemTempDir(const Twine &Prefix,
return TempPCHFile(std::move(File).str());
}
-llvm::ErrorOr<PrecompiledPreamble::TempPCHFile>
-PrecompiledPreamble::TempPCHFile::createFromCustomPath(const Twine &Path) {
- return TempPCHFile(Path.str());
-}
-
PrecompiledPreamble::TempPCHFile::TempPCHFile(std::string FilePath)
: FilePath(std::move(FilePath)) {
TemporaryFiles::getInstance().addFile(*this->FilePath);
OpenPOWER on IntegriCloud