Make clang's rewrite engine a core feature
authorAlp Toker <alp@nuanti.com>
Wed, 16 Jul 2014 16:48:33 +0000 (16:48 +0000)
committerAlp Toker <alp@nuanti.com>
Wed, 16 Jul 2014 16:48:33 +0000 (16:48 +0000)
The rewrite facility's footprint is small so it's not worth going to these
lengths to support disabling at configure time, particularly since key compiler
features now depend on it.

Meanwhile the Objective-C rewriters have been moved under the
ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still
potentially worth excluding from lightweight builds.

Tests are now passing with any combination of feature flags. The flags
historically haven't been tested by LLVM's build servers so caveat emptor.

llvm-svn: 213171

56 files changed:
clang/CMakeLists.txt
clang/examples/clang-interpreter/Makefile
clang/lib/ARCMigrate/CMakeLists.txt
clang/lib/Frontend/CMakeLists.txt
clang/lib/Frontend/Makefile
clang/lib/Frontend/Rewrite/CMakeLists.txt [moved from clang/lib/Rewrite/Frontend/CMakeLists.txt with 94% similarity]
clang/lib/Frontend/Rewrite/FixItRewriter.cpp [moved from clang/lib/Rewrite/Frontend/FixItRewriter.cpp with 100% similarity]
clang/lib/Frontend/Rewrite/FrontendActions.cpp [moved from clang/lib/Rewrite/Frontend/FrontendActions.cpp with 99% similarity]
clang/lib/Frontend/Rewrite/HTMLPrint.cpp [moved from clang/lib/Rewrite/Frontend/HTMLPrint.cpp with 100% similarity]
clang/lib/Frontend/Rewrite/InclusionRewriter.cpp [moved from clang/lib/Rewrite/Frontend/InclusionRewriter.cpp with 100% similarity]
clang/lib/Frontend/Rewrite/Makefile [moved from clang/lib/Rewrite/Frontend/Makefile with 87% similarity]
clang/lib/Frontend/Rewrite/RewriteMacros.cpp [moved from clang/lib/Rewrite/Frontend/RewriteMacros.cpp with 100% similarity]
clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp [moved from clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp with 99% similarity]
clang/lib/Frontend/Rewrite/RewriteObjC.cpp [moved from clang/lib/Rewrite/Frontend/RewriteObjC.cpp with 99% similarity]
clang/lib/Frontend/Rewrite/RewriteTest.cpp [moved from clang/lib/Rewrite/Frontend/RewriteTest.cpp with 100% similarity]
clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
clang/lib/FrontendTool/Makefile
clang/lib/Index/CMakeLists.txt
clang/lib/Makefile
clang/lib/Rewrite/CMakeLists.txt
clang/lib/Rewrite/Core/CMakeLists.txt [deleted file]
clang/lib/Rewrite/Core/Makefile [deleted file]
clang/lib/Rewrite/DeltaTree.cpp [moved from clang/lib/Rewrite/Core/DeltaTree.cpp with 100% similarity]
clang/lib/Rewrite/HTMLRewrite.cpp [moved from clang/lib/Rewrite/Core/HTMLRewrite.cpp with 100% similarity]
clang/lib/Rewrite/Makefile
clang/lib/Rewrite/RewriteRope.cpp [moved from clang/lib/Rewrite/Core/RewriteRope.cpp with 100% similarity]
clang/lib/Rewrite/Rewriter.cpp [moved from clang/lib/Rewrite/Core/Rewriter.cpp with 100% similarity]
clang/lib/Rewrite/TokenRewriter.cpp [moved from clang/lib/Rewrite/Core/TokenRewriter.cpp with 100% similarity]
clang/lib/StaticAnalyzer/Core/CMakeLists.txt
clang/lib/Tooling/CMakeLists.txt
clang/test/CMakeLists.txt
clang/test/FixIt/lit.local.cfg [deleted file]
clang/test/Makefile
clang/test/Rewriter/lit.local.cfg
clang/test/lit.site.cfg.in
clang/tools/CMakeLists.txt
clang/tools/Makefile
clang/tools/arcmt-test/Makefile
clang/tools/c-arcmt-test/Makefile
clang/tools/c-index-test/Makefile
clang/tools/clang-check/Makefile
clang/tools/clang-format/CMakeLists.txt
clang/tools/clang-format/Makefile
clang/tools/driver/Makefile
clang/tools/libclang/Makefile
clang/unittests/AST/Makefile
clang/unittests/ASTMatchers/Dynamic/Makefile
clang/unittests/ASTMatchers/Makefile
clang/unittests/CMakeLists.txt
clang/unittests/Format/Makefile
clang/unittests/Frontend/Makefile
clang/unittests/Makefile
clang/unittests/Sema/Makefile
clang/unittests/Tooling/CMakeLists.txt
clang/unittests/Tooling/Makefile
clang/unittests/libclang/Makefile

index b93a78e..02374e2 100644 (file)
@@ -391,13 +391,6 @@ else()
   set(ENABLE_CLANG_ARCMT "0")
 endif()
 
-option(CLANG_ENABLE_REWRITER "Build rewriter." ON)
-if (CLANG_ENABLE_REWRITER)
-  set(ENABLE_CLANG_REWRITER "1")
-else()
-  set(ENABLE_CLANG_REWRITER "0")
-endif()
-
 option(CLANG_ENABLE_STATIC_ANALYZER "Build static analyzer." ON)
 if (CLANG_ENABLE_STATIC_ANALYZER)
   set(ENABLE_CLANG_STATIC_ANALYZER "1")
@@ -405,23 +398,13 @@ else()
   set(ENABLE_CLANG_STATIC_ANALYZER "0")
 endif()
 
-if (NOT CLANG_ENABLE_REWRITER AND CLANG_ENABLE_ARCMT)
-  message(FATAL_ERROR "Cannot disable rewriter while enabling ARCMT")
-endif()
-
-if (NOT CLANG_ENABLE_REWRITER AND CLANG_ENABLE_STATIC_ANALYZER)
-  message(FATAL_ERROR "Cannot disable rewriter while enabling static analyzer")
-endif()
-
 if (NOT CLANG_ENABLE_STATIC_ANALYZER AND CLANG_ENABLE_ARCMT)
   message(FATAL_ERROR "Cannot disable static analyzer while enabling ARCMT")
 endif()
 
 if(CLANG_ENABLE_ARCMT)
   add_definitions(-DCLANG_ENABLE_ARCMT)
-endif()
-if(CLANG_ENABLE_REWRITER)
-  add_definitions(-DCLANG_ENABLE_REWRITER)
+  add_definitions(-DCLANG_ENABLE_OBJC_REWRITER)
 endif()
 if(CLANG_ENABLE_STATIC_ANALYZER)
   add_definitions(-DCLANG_ENABLE_STATIC_ANALYZER)
index 6494e9a..d571337 100644 (file)
@@ -20,7 +20,7 @@ LINK_COMPONENTS := jit interpreter nativecodegen bitreader bitwriter irreader \
 USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a clangCodeGen.a \
            clangParse.a clangSema.a clangStaticAnalyzerFrontend.a \
            clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
-           clangAnalysis.a clangRewriteCore.a clangRewriteFrontend.a \
+           clangAnalysis.a clangRewrite.a clangRewriteFrontend.a \
            clangEdit.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
index e5ec607..b716a20 100644 (file)
@@ -31,7 +31,7 @@ add_clang_library(clangARCMigrate
   clangEdit
   clangFrontend
   clangLex
-  clangRewriteCore
+  clangRewrite
   clangSema
   clangSerialization
   clangStaticAnalyzerCheckers
index 3fa7a2c..403cc42 100644 (file)
@@ -1,3 +1,5 @@
+add_subdirectory(Rewrite)
+
 set(LLVM_LINK_COMPONENTS
   Option
   Support
index 3c13ad6..8554b76 100644 (file)
@@ -8,7 +8,7 @@
 ##===----------------------------------------------------------------------===##
 
 CLANG_LEVEL := ../..
+DIRS := Rewrite
 LIBRARYNAME := clangFrontend
 
 include $(CLANG_LEVEL)/Makefile
-
similarity index 94%
rename from clang/lib/Rewrite/Frontend/CMakeLists.txt
rename to clang/lib/Frontend/Rewrite/CMakeLists.txt
index 85af97d..924bf5d 100644 (file)
@@ -18,5 +18,5 @@ add_clang_library(clangRewriteFrontend
   clangEdit
   clangFrontend
   clangLex
-  clangRewriteCore
+  clangRewrite
   )
@@ -146,9 +146,7 @@ bool FixItRecompile::BeginInvocation(CompilerInstance &CI) {
   return true;
 }
 
-//===----------------------------------------------------------------------===//
-// Preprocessor Actions
-//===----------------------------------------------------------------------===//
+#ifdef CLANG_ENABLE_OBJC_REWRITER
 
 ASTConsumer *RewriteObjCAction::CreateASTConsumer(CompilerInstance &CI,
                                                   StringRef InFile) {
@@ -166,6 +164,12 @@ ASTConsumer *RewriteObjCAction::CreateASTConsumer(CompilerInstance &CI,
   return nullptr;
 }
 
+#endif
+
+//===----------------------------------------------------------------------===//
+// Preprocessor Actions
+//===----------------------------------------------------------------------===//
+
 void RewriteMacrosAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
   raw_ostream *OS = CI.createDefaultOutputFile(true, getCurrentFile());
similarity index 87%
rename from clang/lib/Rewrite/Frontend/Makefile
rename to clang/lib/Frontend/Rewrite/Makefile
index ac97d40..1d56547 100644 (file)
@@ -16,3 +16,7 @@ LIBRARYNAME := clangRewriteFrontend
 
 include $(CLANG_LEVEL)/Makefile
 
+ifeq ($(ENABLE_CLANG_ARCMT),1)
+  CXX.Flags += -DCLANG_ENABLE_OBJC_REWRITER
+endif
+
@@ -30,6 +30,8 @@
 #include "llvm/Support/raw_ostream.h"
 #include <memory>
 
+#ifdef CLANG_ENABLE_OBJC_REWRITER
+
 using namespace clang;
 using llvm::utostr;
 
@@ -7754,3 +7756,5 @@ Stmt *RewriteModernObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
     ReplaceStmtWithRange(IV, Replacement, OldRange);
     return Replacement;  
 }
+
+#endif
similarity index 99%
rename from clang/lib/Rewrite/Frontend/RewriteObjC.cpp
rename to clang/lib/Frontend/Rewrite/RewriteObjC.cpp
index dfeb11a..7a72177 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/Support/raw_ostream.h"
 #include <memory>
 
+#ifdef CLANG_ENABLE_OBJC_REWRITER
+
 using namespace clang;
 using llvm::utostr;
 
@@ -5946,3 +5948,5 @@ Stmt *RewriteObjCFragileABI::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
   ReplaceStmtWithRange(IV, Replacement, OldRange);
   return Replacement;  
 }
+
+#endif
index 76baec7..de864f6 100644 (file)
@@ -45,20 +45,12 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
   case DumpTokens:             return new DumpTokensAction();
   case EmitAssembly:           return new EmitAssemblyAction();
   case EmitBC:                 return new EmitBCAction();
-#ifdef CLANG_ENABLE_REWRITER
   case EmitHTML:               return new HTMLPrintAction();
-#else
-  case EmitHTML:               Action = "EmitHTML"; break;
-#endif
   case EmitLLVM:               return new EmitLLVMAction();
   case EmitLLVMOnly:           return new EmitLLVMOnlyAction();
   case EmitCodeGenOnly:        return new EmitCodeGenOnlyAction();
   case EmitObj:                return new EmitObjAction();
-#ifdef CLANG_ENABLE_REWRITER
   case FixIt:                  return new FixItAction();
-#else
-  case FixIt:                  Action = "FixIt"; break;
-#endif
   case GenerateModule:         return new GenerateModuleAction;
   case GeneratePCH:            return new GeneratePCHAction;
   case GeneratePTH:            return new GeneratePTHAction();
@@ -87,25 +79,17 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
   case PrintDeclContext:       return new DeclContextPrintAction();
   case PrintPreamble:          return new PrintPreambleAction();
   case PrintPreprocessedInput: {
-    if (CI.getPreprocessorOutputOpts().RewriteIncludes) {
-#ifdef CLANG_ENABLE_REWRITER
+    if (CI.getPreprocessorOutputOpts().RewriteIncludes)
       return new RewriteIncludesAction();
-#else
-      Action = "RewriteIncludesAction";
-      break;
-#endif
-    }
     return new PrintPreprocessedAction();
   }
 
-#ifdef CLANG_ENABLE_REWRITER
   case RewriteMacros:          return new RewriteMacrosAction();
-  case RewriteObjC:            return new RewriteObjCAction();
   case RewriteTest:            return new RewriteTestAction();
+#ifdef CLANG_ENABLE_OBJC_REWRITER
+  case RewriteObjC:            return new RewriteObjCAction();
 #else
-  case RewriteMacros:          Action = "RewriteMacros"; break;
   case RewriteObjC:            Action = "RewriteObjC"; break;
-  case RewriteTest:            Action = "RewriteTest"; break;
 #endif
 #ifdef CLANG_ENABLE_ARCMT
   case MigrateSource:          return new arcmt::MigrateSourceAction();
@@ -121,7 +105,7 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
   }
 
 #if !defined(CLANG_ENABLE_ARCMT) || !defined(CLANG_ENABLE_STATIC_ANALYZER) \
-  || !defined(CLANG_ENABLE_REWRITER)
+  || !defined(CLANG_ENABLE_OBJC_REWRITER)
   CI.getDiagnostics().Report(diag::err_fe_action_not_available) << Action;
   return 0;
 #else
@@ -137,11 +121,9 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
 
   const FrontendOptions &FEOpts = CI.getFrontendOpts();
 
-#ifdef CLANG_ENABLE_REWRITER
   if (FEOpts.FixAndRecompile) {
     Act = new FixItRecompile(Act);
   }
-#endif
   
 #ifdef CLANG_ENABLE_ARCMT
   if (CI.getFrontendOpts().ProgramAction != frontend::MigrateSource &&
index 9ce4b76..dfd2820 100644 (file)
@@ -15,10 +15,7 @@ include $(CLANG_LEVEL)/../../Makefile.config
 
 ifeq ($(ENABLE_CLANG_ARCMT),1)
   CXX.Flags += -DCLANG_ENABLE_ARCMT
-endif
-
-ifeq ($(ENABLE_CLANG_REWRITER),1)
-  CXX.Flags += -DCLANG_ENABLE_REWRITER
+  CXX.Flags += -DCLANG_ENABLE_OBJC_REWRITER
 endif
 
 ifeq ($(ENABLE_CLANG_STATIC_ANALYZER),1)
index fd9810d..1ebb636 100644 (file)
@@ -14,6 +14,6 @@ add_clang_library(clangIndex
   clangBasic
   clangFormat
   clangLex
-  clangRewriteCore
+  clangRewrite
   clangTooling
   )
index 6663268..acf8089 100755 (executable)
@@ -11,14 +11,10 @@ CLANG_LEVEL := ..
 # ARCMigrate and Rewrite are always needed because of libclang.
 PARALLEL_DIRS = Headers Basic Lex Parse AST Sema CodeGen Analysis Frontend \
                 FrontendTool Tooling Driver Format Edit Rewrite Serialization \
-                Index
+                Index ASTMatchers
 
 include $(CLANG_LEVEL)/../../Makefile.config
 
-ifeq ($(ENABLE_CLANG_REWRITER),1)
-PARALLEL_DIRS += ASTMatchers
-endif
-
 ifeq ($(ENABLE_CLANG_STATIC_ANALYZER),1)
 PARALLEL_DIRS += StaticAnalyzer
 endif
index d3d7543..0c77536 100644 (file)
@@ -1,2 +1,16 @@
-add_subdirectory(Core)
-add_subdirectory(Frontend)
+set(LLVM_LINK_COMPONENTS
+  Support
+  )
+
+add_clang_library(clangRewrite
+  DeltaTree.cpp
+  HTMLRewrite.cpp
+  RewriteRope.cpp
+  Rewriter.cpp
+  TokenRewriter.cpp
+
+  LINK_LIBS
+  clangAST
+  clangBasic
+  clangLex
+  )
diff --git a/clang/lib/Rewrite/Core/CMakeLists.txt b/clang/lib/Rewrite/Core/CMakeLists.txt
deleted file mode 100644 (file)
index 896382c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-set(LLVM_LINK_COMPONENTS
-  Support
-  )
-
-add_clang_library(clangRewriteCore
-  DeltaTree.cpp
-  HTMLRewrite.cpp
-  RewriteRope.cpp
-  Rewriter.cpp
-  TokenRewriter.cpp
-
-  LINK_LIBS
-  clangAST
-  clangBasic
-  clangLex
-  )
diff --git a/clang/lib/Rewrite/Core/Makefile b/clang/lib/Rewrite/Core/Makefile
deleted file mode 100644 (file)
index 8c8d2e4..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- clang/lib/Rewrite/Makefile --------------------------*- Makefile -*-===##
-# 
-#                     The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-# 
-##===----------------------------------------------------------------------===##
-#
-# This implements code transformation / rewriting facilities.
-#
-##===----------------------------------------------------------------------===##
-
-CLANG_LEVEL := ../../..
-LIBRARYNAME := clangRewriteCore
-
-include $(CLANG_LEVEL)/Makefile
-
index 0be84d4..5fef9b2 100644 (file)
@@ -1,4 +1,4 @@
-##===- clang/lib/StaticAnalyzer/Makefile -------------------*- Makefile -*-===##
+##===- clang/lib/Rewrite/Makefile --------------------------*- Makefile -*-===##
 # 
 #                     The LLVM Compiler Infrastructure
 #
@@ -6,9 +6,13 @@
 # License. See LICENSE.TXT for details.
 # 
 ##===----------------------------------------------------------------------===##
+#
+# This implements code transformation / rewriting facilities.
+#
+##===----------------------------------------------------------------------===##
 
 CLANG_LEVEL := ../..
-DIRS := Frontend
-PARALLEL_DIRS := Core
+LIBRARYNAME := clangRewrite
 
 include $(CLANG_LEVEL)/Makefile
+
index 3a00131..59a6b6f 100644 (file)
@@ -45,5 +45,5 @@ add_clang_library(clangStaticAnalyzerCore
   clangAnalysis
   clangBasic
   clangLex
-  clangRewriteCore
+  clangRewrite
   )
index a1bf964..2bf9652 100644 (file)
@@ -17,5 +17,5 @@ add_clang_library(clangTooling
   clangDriver
   clangFrontend
   clangLex
-  clangRewriteCore
+  clangRewrite
   )
index b7d689c..591a927 100644 (file)
@@ -26,17 +26,11 @@ endif ()
 
 list(APPEND CLANG_TEST_DEPS
   clang clang-headers
+  clang-check clang-format
   c-index-test diagtool
   clang-tblgen
   )
 
-if (CLANG_ENABLE_REWRITER)
-  list(APPEND CLANG_TEST_DEPS
-    clang-check
-    clang-format
-  )
-endif ()
-
 if (CLANG_ENABLE_ARCMT)
   list(APPEND CLANG_TEST_DEPS
     arcmt-test
diff --git a/clang/test/FixIt/lit.local.cfg b/clang/test/FixIt/lit.local.cfg
deleted file mode 100644 (file)
index 5bbc711..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-if config.root.clang_rewriter == 0:
-    config.unsupported = True
index da7b965..bd0bd2e 100644 (file)
@@ -47,7 +47,6 @@ lit.site.cfg: FORCE
        @$(ECHOPATH) s=@CLANG_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
        @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
        @$(ECHOPATH) s=@ENABLE_CLANG_ARCMT@=$(ENABLE_CLANG_ARCMT)=g >> lit.tmp
-       @$(ECHOPATH) s=@ENABLE_CLANG_REWRITER@=$(ENABLE_CLANG_REWRITER)=g >> lit.tmp
        @$(ECHOPATH) s=@ENABLE_CLANG_STATIC_ANALYZER@=$(ENABLE_CLANG_STATIC_ANALYZER)=g >> lit.tmp
        @$(ECHOPATH) s=@ENABLE_CLANG_EXAMPLES@=$(ENABLE_CLANG_EXAMPLES)=g >> lit.tmp
        @$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
index 5bbc711..69b733b 100644 (file)
@@ -1,2 +1,3 @@
-if config.root.clang_rewriter == 0:
+# The Objective-C rewriters are currently grouped with ARCMT.
+if config.root.clang_arcmt == 0:
     config.unsupported = True
index 2a28c00..1f0b960 100644 (file)
@@ -16,7 +16,6 @@ config.target_triple = "@TARGET_TRIPLE@"
 config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
 config.clang_arcmt = @ENABLE_CLANG_ARCMT@
 config.clang_staticanalyzer = @ENABLE_CLANG_STATIC_ANALYZER@
-config.clang_rewriter = @ENABLE_CLANG_REWRITER@
 config.clang_examples = @ENABLE_CLANG_EXAMPLES@
 config.enable_shared = @ENABLE_SHARED@
 config.host_arch = "@HOST_ARCH@"
index d3f67a8..90b2225 100644 (file)
@@ -1,9 +1,7 @@
 add_subdirectory(diagtool)
 add_subdirectory(driver)
-if(CLANG_ENABLE_REWRITER)
-  add_subdirectory(clang-format)
-  add_subdirectory(clang-format-vs)
-endif()
+add_subdirectory(clang-format)
+add_subdirectory(clang-format-vs)
 
 add_subdirectory(c-index-test)
 add_subdirectory(libclang)
@@ -12,6 +10,7 @@ if(CLANG_ENABLE_ARCMT)
   add_subdirectory(arcmt-test)
   add_subdirectory(c-arcmt-test)
 endif()
+
 if(CLANG_ENABLE_STATIC_ANALYZER)
   add_subdirectory(clang-check)
 endif()
index 94032d2..2ee1299 100644 (file)
@@ -12,11 +12,7 @@ CLANG_LEVEL := ..
 include $(CLANG_LEVEL)/../../Makefile.config
 
 DIRS := 
-PARALLEL_DIRS := driver diagtool
-
-ifeq ($(ENABLE_CLANG_REWRITER),1)
-  PARALLEL_DIRS += clang-format
-endif
+PARALLEL_DIRS := clang-format driver diagtool
 
 ifeq ($(ENABLE_CLANG_STATIC_ANALYZER), 1)
   PARALLEL_DIRS += clang-check
index 4b9b8db..d9d44bb 100644 (file)
@@ -18,7 +18,7 @@ NO_INSTALL = 1
 
 include $(CLANG_LEVEL)/../../Makefile.config
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
-USEDLIBS = clangARCMigrate.a clangRewriteCore.a \
+USEDLIBS = clangARCMigrate.a clangRewrite.a \
                 clangFrontend.a clangDriver.a clangSerialization.a clangParse.a \
                 clangSema.a clangEdit.a clangAnalysis.a clangAST.a clangLex.a \
                 clangBasic.a
index 0be3bc1..e7d5be7 100644 (file)
@@ -31,7 +31,7 @@ USEDLIBS = clang.a \
           clangFormat.a \
           clangTooling.a \
           clangRewriteFrontend.a \
-          clangRewriteCore.a \
+          clangRewrite.a \
           clangFrontend.a clangDriver.a \
           clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
           clangSerialization.a clangParse.a clangSema.a \
index b38d654..42bfbb0 100644 (file)
@@ -27,7 +27,7 @@ LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 # Note that 'USEDLIBS' must include all of the core clang libraries
 # when -static is given to linker on cygming.
 USEDLIBS = clang.a \
-          clangIndex.a clangFormat.a clangRewriteCore.a \
+          clangIndex.a clangFormat.a clangRewrite.a \
           clangFrontend.a clangDriver.a \
           clangTooling.a \
           clangSerialization.a clangParse.a clangSema.a \
index cf088d2..e98a131 100644 (file)
@@ -20,6 +20,6 @@ USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a \
            clangTooling.a clangParse.a clangSema.a \
            clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a \
            clangStaticAnalyzerCore.a clangAnalysis.a clangRewriteFrontend.a \
-           clangRewriteCore.a clangEdit.a clangAST.a clangLex.a clangBasic.a
+           clangRewrite.a clangEdit.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
index b029f71..f80a3ec 100644 (file)
@@ -8,7 +8,7 @@ target_link_libraries(clang-format
   clangBasic
   clangFormat
   clangLex
-  clangRewriteCore
+  clangRewrite
   clangTooling
   )
 
index 4902244..a26ef59 100644 (file)
@@ -18,7 +18,7 @@ include $(CLANG_LEVEL)/../../Makefile.config
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 USEDLIBS = clangFormat.a clangTooling.a clangFrontend.a clangSerialization.a \
           clangDriver.a clangParse.a clangSema.a clangAnalysis.a \
-           clangRewriteFrontend.a clangRewriteCore.a clangEdit.a clangAST.a \
+           clangRewriteFrontend.a clangRewrite.a clangEdit.a clangAST.a \
            clangLex.a clangBasic.a 
 
 include $(CLANG_LEVEL)/Makefile
index 7404496..347702e 100644 (file)
@@ -35,7 +35,8 @@ LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
                    instrumentation ipo irreader linker objcarcopts option \
                    profiledata selectiondag
 USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
-           clangSerialization.a clangCodeGen.a clangParse.a clangSema.a
+           clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
+           clangRewriteFrontend.a clangRewrite.a
 
 ifeq ($(ENABLE_CLANG_STATIC_ANALYZER),1)
 USEDLIBS += clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a \
@@ -46,10 +47,6 @@ ifeq ($(ENABLE_CLANG_ARCMT),1)
 USEDLIBS += clangARCMigrate.a
 endif
 
-ifeq ($(ENABLE_CLANG_REWRITER),1)
-USEDLIBS += clangRewriteFrontend.a clangRewriteCore.a
-endif
-
 USEDLIBS += clangAnalysis.a clangEdit.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
index c03f38b..db3d4f8 100644 (file)
@@ -25,7 +25,7 @@ USEDLIBS = clangIndex.a clangARCMigrate.a \
           clangSerialization.a \
           clangParse.a clangSema.a \
           clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
-          clangRewriteCore.a \
+          clangRewrite.a \
           clangAnalysis.a clangEdit.a \
           clangASTMatchers.a \
           clangAST.a clangLex.a clangBasic.a \
index 0282d21..e3b3d7d 100644 (file)
@@ -12,7 +12,7 @@ TESTNAME = AST
 include $(CLANG_LEVEL)/../../Makefile.config
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
-           clangRewriteCore.a clangRewriteFrontend.a \
+           clangRewrite.a clangRewriteFrontend.a \
            clangParse.a clangSema.a clangAnalysis.a \
            clangEdit.a clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
 
index 66b183c..dfd0086 100644 (file)
@@ -13,7 +13,7 @@ TESTNAME = DynamicASTMatchers
 include $(CLANG_LEVEL)/../../Makefile.config
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
-           clangRewriteCore.a clangRewriteFrontend.a clangParse.a clangSema.a \
+           clangRewrite.a clangRewriteFrontend.a clangParse.a clangSema.a \
            clangAnalysis.a clangEdit.a clangAST.a clangASTMatchers.a \
            clangLex.a clangBasic.a clangDynamicASTMatchers.a
 
index dad300c..92f2fa0 100644 (file)
@@ -15,7 +15,7 @@ TESTNAME = ASTMatchers
 include $(CLANG_LEVEL)/../../Makefile.config
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
-           clangRewriteCore.a clangRewriteFrontend.a \
+           clangRewrite.a clangRewriteFrontend.a \
            clangParse.a clangSema.a clangAnalysis.a \
            clangEdit.a clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
 
index cc13226..936b8b2 100644 (file)
@@ -15,13 +15,12 @@ add_subdirectory(Driver)
 if(CLANG_ENABLE_STATIC_ANALYZER)
   add_subdirectory(Frontend)
 endif()
-if(CLANG_ENABLE_REWRITER)
-  add_subdirectory(ASTMatchers)
-  add_subdirectory(AST)
-  add_subdirectory(Tooling)
-  add_subdirectory(Format)
-  add_subdirectory(Sema)
-endif()
-if(NOT WIN32) # FIXME:Investigating.
+add_subdirectory(ASTMatchers)
+add_subdirectory(AST)
+add_subdirectory(Tooling)
+add_subdirectory(Format)
+add_subdirectory(Sema)
+# FIXME: Why are the libclang unit tests disabled on Windows?
+if(NOT WIN32) 
   add_subdirectory(libclang)
 endif()
index 7de127c..e6dce4d 100644 (file)
@@ -12,7 +12,7 @@ TESTNAME = Format
 include $(CLANG_LEVEL)/../../Makefile.config
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 USEDLIBS = clangFormat.a clangTooling.a clangFrontend.a clangSerialization.a \
-           clangDriver.a clangParse.a clangRewriteCore.a \
+           clangDriver.a clangParse.a clangRewrite.a \
            clangRewriteFrontend.a clangSema.a clangAnalysis.a clangEdit.a \
            clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
 
index 7de9fb4..a63ae18 100644 (file)
@@ -14,7 +14,7 @@ LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
            clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
            clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
-           clangARCMigrate.a clangRewriteCore.a \
+           clangARCMigrate.a clangRewrite.a \
                   clangRewriteFrontend.a clangEdit.a \
            clangAnalysis.a clangAST.a clangLex.a clangBasic.a
 
index 9b95a6e..95b1639 100644 (file)
@@ -14,14 +14,10 @@ ifndef CLANG_LEVEL
 
 IS_UNITTEST_LEVEL := 1
 CLANG_LEVEL := ..
-PARALLEL_DIRS = Basic Lex Driver libclang
+PARALLEL_DIRS = Basic Lex Driver libclang Format ASTMatchers AST Tooling Sema
 
 include $(CLANG_LEVEL)/../..//Makefile.config
 
-ifeq ($(ENABLE_CLANG_REWRITER),1)
-PARALLEL_DIRS += Format ASTMatchers AST Tooling Sema
-endif
-
 ifeq ($(ENABLE_CLANG_ARCMT),1)
 PARALLEL_DIRS += Frontend
 endif
index cd1d93d..7fd5c27 100644 (file)
@@ -12,7 +12,7 @@ TESTNAME = Sema
 include $(CLANG_LEVEL)/../../Makefile.config
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
-           clangRewriteCore.a clangRewriteFrontend.a \
+           clangRewrite.a clangRewriteFrontend.a \
            clangParse.a clangSema.a clangAnalysis.a \
            clangEdit.a clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
 
index c59ff87..a41d87c 100644 (file)
@@ -19,6 +19,6 @@ target_link_libraries(ToolingTests
   clangBasic
   clangFrontend
   clangLex
-  clangRewriteCore
+  clangRewrite
   clangTooling
   )
index 9d36f1f..46af8a1 100644 (file)
@@ -12,7 +12,7 @@ TESTNAME = Tooling
 include $(CLANG_LEVEL)/../../Makefile.config
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
-           clangParse.a clangRewriteCore.a clangRewriteFrontend.a \
+           clangParse.a clangRewrite.a clangRewriteFrontend.a \
           clangSema.a clangAnalysis.a clangEdit.a \
            clangAST.a clangASTMatchers.a clangLex.a clangBasic.a
 
index 7b14c82..a6590eb 100644 (file)
@@ -17,7 +17,7 @@ LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
 # Note that 'USEDLIBS' must include all of the core clang libraries
 # when -static is given to linker on cygming.
 USEDLIBS = clang.a \
-          clangIndex.a clangFormat.a clangRewriteCore.a \
+          clangIndex.a clangFormat.a clangRewrite.a \
           clangFrontend.a clangDriver.a \
           clangTooling.a \
           clangSerialization.a clangParse.a clangSema.a \