Index: llvm/include/llvm/LinkAllPasses.h =================================================================== --- llvm/include/llvm/LinkAllPasses.h +++ llvm/include/llvm/LinkAllPasses.h @@ -37,6 +37,14 @@ #include "llvm/Transforms/Vectorize.h" #include +namespace llvm { + extern void initializeAllPasses(PassRegistry &Registry); +} + +// LLVM_LINKALLPASSES_IFACE suppresses redundant individual passes. +// LinkAllPasses.cpp has them. + +#if !defined(LLVM_LINKALLPASSES_IFACE) namespace { struct ForcePassLinking { ForcePassLinking() { @@ -167,5 +175,6 @@ } } ForcePassLinking; // Force link by creating a global definition. } +#endif #endif Index: llvm/lib/Transforms/CMakeLists.txt =================================================================== --- llvm/lib/Transforms/CMakeLists.txt +++ llvm/lib/Transforms/CMakeLists.txt @@ -1,3 +1,7 @@ +add_llvm_library(LLVMAllPasses + LinkAllPasses.cpp + ) + add_subdirectory(Utils) add_subdirectory(Instrumentation) add_subdirectory(InstCombine) Index: llvm/lib/Transforms/LLVMBuild.txt =================================================================== --- llvm/lib/Transforms/LLVMBuild.txt +++ llvm/lib/Transforms/LLVMBuild.txt @@ -22,3 +22,10 @@ type = Group name = Transforms parent = Libraries + +; It should correspond to LinkAllPasses.h. +[component_1] +type = Library +name = AllPasses +parent = Libraries +required_libraries = Analysis Core Instrumentation IPA IPO ObjCARC Scalar InstCombine TransformUtils Target Vectorize Index: llvm/lib/Transforms/LinkAllPasses.cpp =================================================================== --- /dev/null +++ llvm/lib/Transforms/LinkAllPasses.cpp @@ -0,0 +1,31 @@ +//===-- LinkAllPasses.cpp -------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file references all known passes. +// +//===----------------------------------------------------------------------===// + +#include "llvm/LinkAllPasses.h" + +using namespace llvm; + +void llvm::initializeAllPasses(PassRegistry &Registry) { + initializeCore(Registry); + initializeDebugIRPass(Registry); + initializeScalarOpts(Registry); + initializeObjCARCOpts(Registry); + initializeVectorization(Registry); + initializeIPO(Registry); + initializeAnalysis(Registry); + initializeIPA(Registry); + initializeTransformUtils(Registry); + initializeInstCombine(Registry); + initializeInstrumentation(Registry); + initializeTarget(Registry); +} Index: llvm/lib/Transforms/Makefile =================================================================== --- llvm/lib/Transforms/Makefile +++ llvm/lib/Transforms/Makefile @@ -8,6 +8,8 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. +LIBRARYNAME = LLVMAllPasses +BUILD_ARCHIVE = 1 PARALLEL_DIRS = Utils Instrumentation Scalar InstCombine IPO Vectorize Hello ObjCARC include $(LEVEL)/Makefile.config Index: llvm/tools/bugpoint/CMakeLists.txt =================================================================== --- llvm/tools/bugpoint/CMakeLists.txt +++ llvm/tools/bugpoint/CMakeLists.txt @@ -1,19 +1,12 @@ set(LLVM_LINK_COMPONENTS - Analysis + AllPasses BitWriter Core - IPA IPO IRReader - InstCombine - Instrumentation Linker - ObjCARCOpts - ScalarOpts Support - Target TransformUtils - Vectorize ) # Support plugins. Index: llvm/tools/bugpoint/Makefile =================================================================== --- llvm/tools/bugpoint/Makefile +++ llvm/tools/bugpoint/Makefile @@ -9,8 +9,9 @@ LEVEL := ../.. TOOLNAME := bugpoint -LINK_COMPONENTS := asmparser instrumentation scalaropts ipo linker bitreader \ - bitwriter irreader vectorize objcarcopts +LINK_COMPONENTS := allpasses bitwriter core ipo irreader linker \ + support transformutils + # Support plugins. NO_DEAD_STRIP := 1 Index: llvm/tools/bugpoint/bugpoint.cpp =================================================================== --- llvm/tools/bugpoint/bugpoint.cpp +++ llvm/tools/bugpoint/bugpoint.cpp @@ -13,6 +13,8 @@ // //===----------------------------------------------------------------------===// +#define LLVM_LINKALLPASSES_IFACE + #include "BugDriver.h" #include "ToolRunner.h" #include "llvm/IR/LLVMContext.h" @@ -118,17 +120,7 @@ // Initialize passes PassRegistry &Registry = *PassRegistry::getPassRegistry(); - initializeCore(Registry); - initializeScalarOpts(Registry); - initializeObjCARCOpts(Registry); - initializeVectorization(Registry); - initializeIPO(Registry); - initializeAnalysis(Registry); - initializeIPA(Registry); - initializeTransformUtils(Registry); - initializeInstCombine(Registry); - initializeInstrumentation(Registry); - initializeTarget(Registry); + initializeAllPasses(Registry); cl::ParseCommandLineOptions(argc, argv, "LLVM automatic testcase reducer. See\nhttp://" Index: llvm/tools/opt/CMakeLists.txt =================================================================== --- llvm/tools/opt/CMakeLists.txt +++ llvm/tools/opt/CMakeLists.txt @@ -1,20 +1,14 @@ set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} + AllPasses Analysis BitWriter Core IPA IPO IRReader - InstCombine - Instrumentation MC - ObjCARCOpts - ScalarOpts Support - Target - TransformUtils - Vectorize ) # Support plugins. Index: llvm/tools/opt/Makefile =================================================================== --- llvm/tools/opt/Makefile +++ llvm/tools/opt/Makefile @@ -9,7 +9,8 @@ LEVEL := ../.. TOOLNAME := opt -LINK_COMPONENTS := bitreader bitwriter asmparser irreader instrumentation scalaropts objcarcopts ipo vectorize all-targets +LINK_COMPONENTS := allpasses analysis bitwriter core ipa ipo irreader mc \ + support all-targets # Support plugins. NO_DEAD_STRIP := 1 Index: llvm/tools/opt/opt.cpp =================================================================== --- llvm/tools/opt/opt.cpp +++ llvm/tools/opt/opt.cpp @@ -12,6 +12,8 @@ // //===----------------------------------------------------------------------===// +#define LLVM_LINKALLPASSES_IFACE + #include "NewPMDriver.h" #include "llvm/ADT/StringSet.h" #include "llvm/ADT/Triple.h" @@ -608,18 +610,7 @@ // Initialize passes PassRegistry &Registry = *PassRegistry::getPassRegistry(); - initializeCore(Registry); - initializeDebugIRPass(Registry); - initializeScalarOpts(Registry); - initializeObjCARCOpts(Registry); - initializeVectorization(Registry); - initializeIPO(Registry); - initializeAnalysis(Registry); - initializeIPA(Registry); - initializeTransformUtils(Registry); - initializeInstCombine(Registry); - initializeInstrumentation(Registry); - initializeTarget(Registry); + initializeAllPasses(Registry); cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .bc modular optimizer and analysis printer\n");