forked from OSchip/llvm-project
Make clang's rewrite engine a core feature
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
This commit is contained in:
parent
db829de6d6
commit
0621cb2e7d
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -31,7 +31,7 @@ add_clang_library(clangARCMigrate
|
|||
clangEdit
|
||||
clangFrontend
|
||||
clangLex
|
||||
clangRewriteCore
|
||||
clangRewrite
|
||||
clangSema
|
||||
clangSerialization
|
||||
clangStaticAnalyzerCheckers
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
add_subdirectory(Rewrite)
|
||||
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
Option
|
||||
Support
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
##===----------------------------------------------------------------------===##
|
||||
|
||||
CLANG_LEVEL := ../..
|
||||
DIRS := Rewrite
|
||||
LIBRARYNAME := clangFrontend
|
||||
|
||||
include $(CLANG_LEVEL)/Makefile
|
||||
|
||||
|
|
|
@ -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());
|
|
@ -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
|
|
@ -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
|
|
@ -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 &&
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -14,6 +14,6 @@ add_clang_library(clangIndex
|
|||
clangBasic
|
||||
clangFormat
|
||||
clangLex
|
||||
clangRewriteCore
|
||||
clangRewrite
|
||||
clangTooling
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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
|
||||
)
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
@ -45,5 +45,5 @@ add_clang_library(clangStaticAnalyzerCore
|
|||
clangAnalysis
|
||||
clangBasic
|
||||
clangLex
|
||||
clangRewriteCore
|
||||
clangRewrite
|
||||
)
|
||||
|
|
|
@ -17,5 +17,5 @@ add_clang_library(clangTooling
|
|||
clangDriver
|
||||
clangFrontend
|
||||
clangLex
|
||||
clangRewriteCore
|
||||
clangRewrite
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
if config.root.clang_rewriter == 0:
|
||||
config.unsupported = True
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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@"
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -8,7 +8,7 @@ target_link_libraries(clang-format
|
|||
clangBasic
|
||||
clangFormat
|
||||
clangLex
|
||||
clangRewriteCore
|
||||
clangRewrite
|
||||
clangTooling
|
||||
)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -19,6 +19,6 @@ target_link_libraries(ToolingTests
|
|||
clangBasic
|
||||
clangFrontend
|
||||
clangLex
|
||||
clangRewriteCore
|
||||
clangRewrite
|
||||
clangTooling
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
Loading…
Reference in New Issue