[PATCH] D33270: [Frontend] Remove unused TemporaryFiles
Krasimir Georgiev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 17 02:27:34 PDT 2017
krasimir created this revision.
OnDiskData.TemporaryFiles is filled only by ASTUnit::addTemporaryFile, which is
dead. Also these files are used nowhere in the frontend nor in libclang.
https://reviews.llvm.org/D33270
Files:
include/clang/Frontend/ASTUnit.h
lib/Frontend/ASTUnit.cpp
Index: lib/Frontend/ASTUnit.cpp
===================================================================
--- lib/Frontend/ASTUnit.cpp
+++ lib/Frontend/ASTUnit.cpp
@@ -84,13 +84,6 @@
/// \brief The file in which the precompiled preamble is stored.
std::string PreambleFile;
- /// \brief Temporary files that should be removed when the ASTUnit is
- /// destroyed.
- SmallVector<std::string, 4> TemporaryFiles;
-
- /// \brief Erase temporary files.
- void CleanTemporaryFiles();
-
/// \brief Erase the preamble file.
void CleanPreambleFile();
@@ -163,21 +156,14 @@
return getOnDiskData(AU).PreambleFile;
}
-void OnDiskData::CleanTemporaryFiles() {
- for (StringRef File : TemporaryFiles)
- llvm::sys::fs::remove(File);
- TemporaryFiles.clear();
-}
-
void OnDiskData::CleanPreambleFile() {
if (!PreambleFile.empty()) {
llvm::sys::fs::remove(PreambleFile);
PreambleFile.clear();
}
}
void OnDiskData::Cleanup() {
- CleanTemporaryFiles();
CleanPreambleFile();
}
@@ -194,14 +180,6 @@
llvm::DeleteContainerSeconds(FileDecls);
}
-void ASTUnit::CleanTemporaryFiles() {
- getOnDiskData(this).CleanTemporaryFiles();
-}
-
-void ASTUnit::addTemporaryFile(StringRef TempFile) {
- getOnDiskData(this).TemporaryFiles.push_back(TempFile);
-}
-
/// \brief After failing to build a precompiled preamble (due to
/// errors in the source that occurs in the preamble), the number of
/// reparses during which we'll skip even trying to precompile the
@@ -1100,7 +1078,6 @@
// Clear out old caches and data.
TopLevelDecls.clear();
clearFileLevelDecls();
- CleanTemporaryFiles();
if (!OverrideMainBuffer) {
checkAndRemoveNonDriverDiags(StoredDiagnostics);
Index: include/clang/Frontend/ASTUnit.h
===================================================================
--- include/clang/Frontend/ASTUnit.h
+++ include/clang/Frontend/ASTUnit.h
@@ -419,7 +419,6 @@
explicit ASTUnit(bool MainFileIsAST);
- void CleanTemporaryFiles();
bool Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
std::unique_ptr<llvm::MemoryBuffer> OverrideMainBuffer);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33270.99262.patch
Type: text/x-patch
Size: 2159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170517/ab473054/attachment.bin>
More information about the cfe-commits
mailing list