r303265 - [Frontend] Remove unused TemporaryFiles
Krasimir Georgiev via cfe-commits
cfe-commits at lists.llvm.org
Wed May 17 07:51:45 PDT 2017
Author: krasimir
Date: Wed May 17 09:51:44 2017
New Revision: 303265
URL: http://llvm.org/viewvc/llvm-project?rev=303265&view=rev
Log:
[Frontend] Remove unused TemporaryFiles
Summary:
OnDiskData.TemporaryFiles is filled only by ASTUnit::addTemporaryFile, which is
dead. Also these files are used nowhere in the frontend nor in libclang.
Reviewers: bkramer, ilya-biryukov
Reviewed By: bkramer, ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33270
Modified:
cfe/trunk/include/clang/Frontend/ASTUnit.h
cfe/trunk/lib/Frontend/ASTUnit.cpp
Modified: cfe/trunk/include/clang/Frontend/ASTUnit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTUnit.h?rev=303265&r1=303264&r2=303265&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ASTUnit.h (original)
+++ cfe/trunk/include/clang/Frontend/ASTUnit.h Wed May 17 09:51:44 2017
@@ -419,7 +419,6 @@ private:
explicit ASTUnit(bool MainFileIsAST);
- void CleanTemporaryFiles();
bool Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
std::unique_ptr<llvm::MemoryBuffer> OverrideMainBuffer);
@@ -530,11 +529,6 @@ public:
ASTMutationListener *getASTMutationListener();
ASTDeserializationListener *getDeserializationListener();
- /// \brief Add a temporary file that the ASTUnit depends on.
- ///
- /// This file will be erased when the ASTUnit is destroyed.
- void addTemporaryFile(StringRef TempFile);
-
bool getOnlyLocalDecls() const { return OnlyLocalDecls; }
bool getOwnsRemappedFileBuffers() const { return OwnsRemappedFileBuffers; }
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=303265&r1=303264&r2=303265&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Wed May 17 09:51:44 2017
@@ -84,13 +84,6 @@ namespace {
/// \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,12 +156,6 @@ static const std::string &getPreambleFil
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);
@@ -177,7 +164,6 @@ void OnDiskData::CleanPreambleFile() {
}
void OnDiskData::Cleanup() {
- CleanTemporaryFiles();
CleanPreambleFile();
}
@@ -194,14 +180,6 @@ void ASTUnit::clearFileLevelDecls() {
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 @@ bool ASTUnit::Parse(std::shared_ptr<PCHC
// Clear out old caches and data.
TopLevelDecls.clear();
clearFileLevelDecls();
- CleanTemporaryFiles();
if (!OverrideMainBuffer) {
checkAndRemoveNonDriverDiags(StoredDiagnostics);
More information about the cfe-commits
mailing list