[PATCH] clang-replace: Re-org of file structure

Edwin Vane edwin.vane at intel.com
Fri Aug 30 07:33:12 PDT 2013


    - Fixed header guards

Hi klimek, chandlerc,

http://llvm-reviews.chandlerc.com/D1548

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1548?vs=3924&id=3925#toc

BRANCH
  reorg

ARCANIST PROJECT
  clang-tools-extra

Files:
  clang-replace/CMakeLists.txt
  clang-replace/Makefile
  clang-replace/include/clang-replace/Tooling/ApplyReplacements.h
  clang-replace/ApplyReplacements.h
  clang-replace/lib/Tooling/ApplyReplacements.cpp
  clang-replace/ApplyReplacements.cpp
  clang-replace/lib/Tooling/Makefile
  clang-replace/tool/ClangReplaceMain.cpp
  clang-replace/tool/Makefile

Index: clang-replace/CMakeLists.txt
===================================================================
--- clang-replace/CMakeLists.txt
+++ clang-replace/CMakeLists.txt
@@ -7,13 +7,16 @@
   )
 
 add_clang_library(clangReplace
-  ApplyReplacements.cpp
+  lib/Tooling/ApplyReplacements.cpp
   )
 target_link_libraries(clangReplace
   clangTooling
   clangBasic
   clangRewriteFrontend
   )
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  include
+  )
 add_subdirectory(tool)
Index: clang-replace/Makefile
===================================================================
--- clang-replace/Makefile
+++ clang-replace/Makefile
@@ -8,9 +8,8 @@
 ##===----------------------------------------------------------------------===##
 
 CLANG_LEVEL := ../../..
-LIBRARYNAME := clangReplace
 include $(CLANG_LEVEL)/../../Makefile.config
 
-DIRS = tool
+DIRS = lib/Replace tool
 
 include $(CLANG_LEVEL)/Makefile
Index: clang-replace/include/clang-replace/Tooling/ApplyReplacements.h
===================================================================
--- clang-replace/include/clang-replace/Tooling/ApplyReplacements.h
+++ clang-replace/include/clang-replace/Tooling/ApplyReplacements.h
@@ -1,4 +1,4 @@
-//===-- Core/ApplyChangeDescriptions.h --------------------------*- C++ -*-===//
+//===-- ApplyReplacements.h - Deduplicate and apply replacements -- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,13 +8,13 @@
 //===----------------------------------------------------------------------===//
 ///
 /// \file
-/// \brief This file provides the interface for finding and applying change
-/// description files.
+/// \brief This file provides the interface for deduplicating, detecting
+/// conflicts in, and applying collections of Replacements.
 ///
 //===----------------------------------------------------------------------===//
 
-#ifndef CPP11_MIGRATE_APPLYCHANGEDESCRIPTIONS_H
-#define CPP11_MIGRATE_APPLYCHANGEDESCRIPTIONS_H
+#ifndef LLVM_CLANG_APPLYREPLACEMENTS_H
+#define LLVM_CLANG_APPLYREPLACEMENTS_H
 
 #include "clang/Tooling/Refactoring.h"
 #include "llvm/ADT/StringMap.h"
@@ -111,4 +111,4 @@
 } // end namespace replace
 } // end namespace clang
 
-#endif // CPP11_MIGRATE_APPLYCHANGEDESCRIPTIONS_H
+#endif // LLVM_CLANG_APPLYREPLACEMENTS_H
Index: clang-replace/lib/Tooling/ApplyReplacements.cpp
===================================================================
--- clang-replace/lib/Tooling/ApplyReplacements.cpp
+++ clang-replace/lib/Tooling/ApplyReplacements.cpp
@@ -1,4 +1,4 @@
-//===-- Core/ApplyChangeDescriptions.cpp ----------------------------------===//
+//===-- ApplyReplacements.cpp - Apply and deduplicate replacements --------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,11 +8,13 @@
 //===----------------------------------------------------------------------===//
 ///
 /// \file
-/// \brief This file provides the implementation for finding and applying change
-/// description files.
+/// \brief This file provides the implementation for deduplicating, detecting
+/// conflicts in, and applying collections of Replacements.
+///
+/// FIXME: Use Diagnostics for output instead of llvm::errs().
 ///
 //===----------------------------------------------------------------------===//
-#include "ApplyReplacements.h"
+#include "clang-replace/Tooling/ApplyReplacements.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Rewrite/Core/Rewriter.h"
@@ -32,6 +34,7 @@
 namespace clang {
 namespace replace {
 
+
 llvm::error_code
 collectReplacementsFromDirectory(const llvm::StringRef Directory,
                                  TUReplacements &TUs,
@@ -173,8 +176,6 @@
                          FileToReplacementsMap &GroupedReplacements,
                          clang::SourceManager &SM) {
 
-  // FIXME: Use Diagnostics for output
-
   // Group all replacements by target file.
   for (TUReplacements::const_iterator TUI = TUs.begin(), TUE = TUs.end();
        TUI != TUE; ++TUI)
Index: clang-replace/lib/Tooling/Makefile
===================================================================
--- clang-replace/lib/Tooling/Makefile
+++ clang-replace/lib/Tooling/Makefile
@@ -1,3 +1,4 @@
+
 ##===- clang-replace/Makefile ------------------------------*- Makefile -*-===##
 #
 #                     The LLVM Compiler Infrastructure
@@ -7,10 +8,8 @@
 #
 ##===----------------------------------------------------------------------===##
 
-CLANG_LEVEL := ../../..
+CLANG_LEVEL := ../../../../..
 LIBRARYNAME := clangReplace
 include $(CLANG_LEVEL)/../../Makefile.config
-
-DIRS = tool
-
 include $(CLANG_LEVEL)/Makefile
+CPP.Flags += -I$(PROJ_SRC_DIR)/../../include
Index: clang-replace/tool/ClangReplaceMain.cpp
===================================================================
--- clang-replace/tool/ClangReplaceMain.cpp
+++ clang-replace/tool/ClangReplaceMain.cpp
@@ -12,7 +12,7 @@
 ///
 //===----------------------------------------------------------------------===//
 
-#include "ApplyReplacements.h"
+#include "clang-replace/Tooling/ApplyReplacements.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Basic/SourceManager.h"
Index: clang-replace/tool/Makefile
===================================================================
--- clang-replace/tool/Makefile
+++ clang-replace/tool/Makefile
@@ -25,4 +25,4 @@
 
 include $(CLANG_LEVEL)/Makefile
 
-CPP.Flags += -I$(PROJ_SRC_DIR)/..
+CPP.Flags += -I$(PROJ_SRC_DIR)/../include
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1548.3.patch
Type: text/x-patch
Size: 5572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130830/10a6b7df/attachment.bin>


More information about the cfe-commits mailing list