diff --git a/llvm/docs/WritingAnLLVMPass.rst b/llvm/docs/WritingAnLLVMPass.rst --- a/llvm/docs/WritingAnLLVMPass.rst +++ b/llvm/docs/WritingAnLLVMPass.rst @@ -1300,11 +1300,6 @@ ``RegisterScheduler::FunctionPassCtor`` is significantly different from ``RegisterRegAlloc::FunctionPassCtor``. -To force the load/linking of your register allocator into the -:program:`llc`/:program:`lli` tools, add your creator function's global -declaration to ``Passes.h`` and add a "pseudo" call line to -``llvm/Codegen/LinkAllCodegenComponents.h``. - Creating new registries ----------------------- diff --git a/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h b/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h deleted file mode 100644 --- a/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h +++ /dev/null @@ -1,54 +0,0 @@ -//===- llvm/Codegen/LinkAllCodegenComponents.h ------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This header file pulls in all codegen related passes for tools like lli and -// llc that need this functionality. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CODEGEN_LINKALLCODEGENCOMPONENTS_H -#define LLVM_CODEGEN_LINKALLCODEGENCOMPONENTS_H - -#include "llvm/CodeGen/BuiltinGCs.h" -#include "llvm/CodeGen/Passes.h" -#include "llvm/CodeGen/SchedulerRegistry.h" -#include "llvm/Target/TargetMachine.h" -#include - -namespace { - struct ForceCodegenLinking { - ForceCodegenLinking() { - // We must reference the passes in such a way that compilers will not - // delete it all as dead code, even with whole program optimization, - // yet is effectively a NO-OP. As the compiler isn't smart enough - // to know that getenv() never returns -1, this will do the job. - if (std::getenv("bar") != (char*) -1) - return; - - (void) llvm::createFastRegisterAllocator(); - (void) llvm::createBasicRegisterAllocator(); - (void) llvm::createGreedyRegisterAllocator(); - (void) llvm::createDefaultPBQPRegisterAllocator(); - - llvm::linkAllBuiltinGCs(); - - (void) llvm::createBURRListDAGScheduler(nullptr, - llvm::CodeGenOpt::Default); - (void) llvm::createSourceListDAGScheduler(nullptr, - llvm::CodeGenOpt::Default); - (void) llvm::createHybridListDAGScheduler(nullptr, - llvm::CodeGenOpt::Default); - (void) llvm::createFastDAGScheduler(nullptr, llvm::CodeGenOpt::Default); - (void) llvm::createDefaultScheduler(nullptr, llvm::CodeGenOpt::Default); - (void) llvm::createVLIWDAGScheduler(nullptr, llvm::CodeGenOpt::Default); - - } - } ForceCodegenLinking; // Force link by creating a global definition. -} - -#endif diff --git a/llvm/include/llvm/module.modulemap b/llvm/include/llvm/module.modulemap --- a/llvm/include/llvm/module.modulemap +++ b/llvm/include/llvm/module.modulemap @@ -26,7 +26,6 @@ // Exclude these; they're intended to be included into only a single // translation unit (or none) and aren't part of this module. exclude header "CodeGen/LinkAllAsmWriterComponents.h" - exclude header "CodeGen/LinkAllCodegenComponents.h" // These are intended for (repeated) textual inclusion. textual header "CodeGen/CommandFlags.inc" diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp --- a/llvm/tools/llc/llc.cpp +++ b/llvm/tools/llc/llc.cpp @@ -17,7 +17,6 @@ #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/CodeGen/CommandFlags.inc" #include "llvm/CodeGen/LinkAllAsmWriterComponents.h" -#include "llvm/CodeGen/LinkAllCodegenComponents.h" #include "llvm/CodeGen/MIRParser/MIRParser.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineModuleInfo.h" diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -17,7 +17,6 @@ #include "llvm/ADT/Triple.h" #include "llvm/Bitcode/BitcodeReader.h" #include "llvm/CodeGen/CommandFlags.inc" -#include "llvm/CodeGen/LinkAllCodegenComponents.h" #include "llvm/Config/llvm-config.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/ExecutionEngine/Interpreter.h"