summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-replace/ApplyReplacements.h
diff options
context:
space:
mode:
authorTareq A. Siraj <tareq.a.siraj@intel.com>2013-08-26 19:58:59 +0000
committerTareq A. Siraj <tareq.a.siraj@intel.com>2013-08-26 19:58:59 +0000
commit11755528532bdd27fd6cbdf0bf5098c8113d7767 (patch)
tree14cb971f2b9bfc3cf72d89efa3d2e61a90f42db8 /clang-tools-extra/clang-replace/ApplyReplacements.h
parentc7ef7a8dd7a8858a60013cce74c2dd7f344a5115 (diff)
downloadbcm5719-llvm-11755528532bdd27fd6cbdf0bf5098c8113d7767.tar.gz
bcm5719-llvm-11755528532bdd27fd6cbdf0bf5098c8113d7767.zip
clang-replace: Delete change description files
Added a command line option "-remove-change-desc-files" that triggers the deletion of the change description files after merging and applying regardless of success. Differential Revision: http://llvm-reviews.chandlerc.com/D1492 llvm-svn: 189268
Diffstat (limited to 'clang-tools-extra/clang-replace/ApplyReplacements.h')
-rw-r--r--clang-tools-extra/clang-replace/ApplyReplacements.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-replace/ApplyReplacements.h b/clang-tools-extra/clang-replace/ApplyReplacements.h
index cf2b3d73591..c69e5bd6eef 100644
--- a/clang-tools-extra/clang-replace/ApplyReplacements.h
+++ b/clang-tools-extra/clang-replace/ApplyReplacements.h
@@ -21,6 +21,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/system_error.h"
#include <vector>
+#include <string>
namespace clang {
@@ -32,6 +33,9 @@ namespace replace {
typedef std::vector<clang::tooling::TranslationUnitReplacements>
TUReplacements;
+/// \brief Collection of TranslationUnitReplacement files.
+typedef std::vector<std::string> TUReplacementFiles;
+
/// \brief Map mapping file name to Replacements targeting that file.
typedef llvm::StringMap<std::vector<clang::tooling::Replacement> >
FileToReplacementsMap;
@@ -47,6 +51,8 @@ FileToReplacementsMap;
/// TranslationUnitReplacements.
/// \param[out] TUs Collection of all found and deserialized
/// TranslationUnitReplacements.
+/// \param[out] TURFiles Collection of all TranslationUnitReplacement files
+/// found in \c Directory.
/// \param[in] Diagnostics DiagnosticsEngine used for error output.
///
/// \returns An error_code indicating success or failure in navigating the
@@ -54,6 +60,7 @@ FileToReplacementsMap;
llvm::error_code
collectReplacementsFromDirectory(const llvm::StringRef Directory,
TUReplacements &TUs,
+ TUReplacementFiles &TURFiles,
clang::DiagnosticsEngine &Diagnostics);
/// \brief Deduplicate, check for conflicts, and apply all Replacements stored
@@ -82,6 +89,17 @@ bool mergeAndDeduplicate(const TUReplacements &TUs,
bool applyReplacements(const FileToReplacementsMap &GroupedReplacements,
clang::SourceManager &SM);
+/// \brief Delete the replacement files.
+///
+/// \param[in] Files Replacement files to delete.
+/// \param[in] Diagnostics DiagnosticsEngine used for error output.
+///
+/// \returns \li true If all files have been deleted successfully.
+/// \li false If at least one or more failures occur when deleting
+/// files.
+bool deleteReplacementFiles(const TUReplacementFiles &Files,
+ clang::DiagnosticsEngine &Diagnostics);
+
} // end namespace replace
} // end namespace clang
OpenPOWER on IntegriCloud