From: Rafael Espindola Date: Wed, 26 Jun 2013 03:52:38 +0000 (+0000) Subject: Remove some uses of llvm::sys::Path. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b804cb315cfeebc4d1c4d2d023ffb08440f77254;p=clang Remove some uses of llvm::sys::Path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184907 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index c915776963..52f7f098d6 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -478,8 +478,8 @@ public: /// \brief Add a temporary file that the ASTUnit depends on. /// /// This file will be erased when the ASTUnit is destroyed. - void addTemporaryFile(const llvm::sys::Path &TempFile); - + void addTemporaryFile(StringRef TempFile); + bool getOnlyLocalDecls() const { return OnlyLocalDecls; } bool getOwnsRemappedFileBuffers() const { return OwnsRemappedFileBuffers; } diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 364d8f3040..e5a8d17c20 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -84,10 +84,10 @@ 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 + /// \brief Temporary files that should be removed when the ASTUnit is /// destroyed. - SmallVector TemporaryFiles; - + SmallVector TemporaryFiles; + /// \brief Erase temporary files. void CleanTemporaryFiles(); @@ -166,8 +166,8 @@ static const std::string &getPreambleFile(const ASTUnit *AU) { void OnDiskData::CleanTemporaryFiles() { for (unsigned I = 0, N = TemporaryFiles.size(); I != N; ++I) - TemporaryFiles[I].eraseFromDisk(); - TemporaryFiles.clear(); + llvm::sys::fs::remove(TemporaryFiles[I]); + TemporaryFiles.clear(); } void OnDiskData::CleanPreambleFile() { @@ -201,7 +201,7 @@ void ASTUnit::CleanTemporaryFiles() { getOnDiskData(this).CleanTemporaryFiles(); } -void ASTUnit::addTemporaryFile(const llvm::sys::Path &TempFile) { +void ASTUnit::addTemporaryFile(StringRef TempFile) { getOnDiskData(this).TemporaryFiles.push_back(TempFile); }