[llvm-commits] [llvm] r135760 - in /llvm/trunk: cmake/modules/LLVMLibDeps.cmake lib/Support/CMakeLists.txt lib/Support/TargetRegistry.cpp lib/Target/CMakeLists.txt lib/Target/TargetRegistry.cpp
Chandler Carruth
chandlerc at gmail.com
Tue Jul 26 17:06:53 PDT 2011
On Tue, Jul 26, 2011 at 4:46 PM, Evan Cheng <evan.cheng at apple.com> wrote:
> Hi Chandler,
>
> Sorry I missed this earlier. I don't think this is the right change.
No problem, I'm open to any suggestions you have here. Without this change,
lots of weird stuff broke due to the Support -> Target -> MC include chain
that existed prior, that was my only motivation for making it at all.
> TargetRegistry is used by everything including those tools which don't need
> Target library e.g. llvm-mc.
>
Hrm, is there a better name for it? TargetRegistry seems very confusing for
something that shouldn't live in Target.
> If you wish for consistency, the right fix is to move TargetRegistry.h to
> Support. But to do that, you would need to move Reloc::Model and
> CodeModel::Model out of MCCodeGenInfo.h first. We can't have something in
> Support that reference MC.
>
I don't have any strong feelings here. Is Support the correct logical home
for the registry? (Is it more like the TargetedPlatformRegistry? maybe
s/Platform/Architecture/ or Backend something...) If so, what would be
required (in brief) to move these pieces to support? I'm happy to take a
look at fixing them once I have an idea of what you'd like these to look
like. =D
>
> Evan
>
> On Jul 22, 2011, at 1:16 AM, Chandler Carruth wrote:
>
> > Author: chandlerc
> > Date: Fri Jul 22 03:16:53 2011
> > New Revision: 135760
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=135760&view=rev
> > Log:
> > Move TargetRegistry.cpp from lib/Support to lib/Target where it belongs.
> > The header file was already properly located. The previous need for it
> > in Support had to do with the version string printing which was fixed in
> > r135757.
> >
> > Also update build dependencies where libraries that needed the
> > functionality of the Target library (in the form of the TargetRegistry)
> > were picking it up via Support. This is pretty pervasive, essentially
> > every TargetInfo library (ARMInfo, etc) uses TargetRegistry, making it
> > depend on Target. All of these were previously just sneaking by.
> >
> > Added:
> > llvm/trunk/lib/Target/TargetRegistry.cpp
> > - copied, changed from r135759,
> llvm/trunk/lib/Support/TargetRegistry.cpp
> > Removed:
> > llvm/trunk/lib/Support/TargetRegistry.cpp
> > Modified:
> > llvm/trunk/cmake/modules/LLVMLibDeps.cmake
> > llvm/trunk/lib/Support/CMakeLists.txt
> > llvm/trunk/lib/Target/CMakeLists.txt
> >
> > Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMLibDeps.cmake?rev=135760&r1=135759&r2=135760&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/cmake/modules/LLVMLibDeps.cmake (original)
> > +++ llvm/trunk/cmake/modules/LLVMLibDeps.cmake Fri Jul 22 03:16:53 2011
> > @@ -3,10 +3,10 @@
> > set(MSVC_LIB_DEPS_LLVMARMCodeGen LLVMARMAsmPrinter LLVMARMDesc
> LLVMARMInfo LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC
> LLVMSelectionDAG LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMARMDesc LLVMARMInfo LLVMMC LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMARMDisassembler LLVMARMDesc LLVMARMInfo LLVMMC
> LLVMSupport)
> > -set(MSVC_LIB_DEPS_LLVMARMInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMARMInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMAlphaCodeGen LLVMAlphaDesc LLVMAlphaInfo
> LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport
> LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMAlphaDesc LLVMAlphaInfo LLVMMC)
> > -set(MSVC_LIB_DEPS_LLVMAlphaInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMAlphaInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMAnalysis LLVMCore LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMArchive LLVMBitReader LLVMCore LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMAsmParser LLVMCore LLVMSupport)
> > @@ -15,16 +15,16 @@
> > set(MSVC_LIB_DEPS_LLVMBitWriter LLVMCore LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMBlackfinCodeGen LLVMAsmPrinter LLVMBlackfinDesc
> LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport
> LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMBlackfinDesc LLVMBlackfinInfo LLVMMC)
> > -set(MSVC_LIB_DEPS_LLVMBlackfinInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMBlackfinInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMCBackend LLVMAnalysis LLVMCBackendInfo LLVMCodeGen
> LLVMCore LLVMMC LLVMScalarOpts LLVMSupport LLVMTarget LLVMTransformUtils)
> > -set(MSVC_LIB_DEPS_LLVMCBackendInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMCBackendInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMCellSPUCodeGen LLVMAsmPrinter LLVMCellSPUDesc
> LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport
> LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMCellSPUDesc LLVMCellSPUInfo LLVMMC)
> > -set(MSVC_LIB_DEPS_LLVMCellSPUInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMCellSPUInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMCodeGen LLVMAnalysis LLVMCore LLVMMC LLVMScalarOpts
> LLVMSupport LLVMTarget LLVMTransformUtils)
> > set(MSVC_LIB_DEPS_LLVMCore LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMCppBackend LLVMCore LLVMCppBackendInfo LLVMSupport
> LLVMTarget)
> > -set(MSVC_LIB_DEPS_LLVMCppBackendInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMCppBackendInfo LLVMMC LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMExecutionEngine LLVMCore LLVMMC LLVMSupport
> LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMInstCombine LLVMAnalysis LLVMCore LLVMSupport
> LLVMTarget LLVMTransformUtils)
> > set(MSVC_LIB_DEPS_LLVMInstrumentation LLVMAnalysis LLVMCore LLVMSupport
> LLVMTransformUtils)
> > @@ -36,37 +36,37 @@
> > set(MSVC_LIB_DEPS_LLVMMBlazeCodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore
> LLVMMBlazeAsmPrinter LLVMMBlazeDesc LLVMMBlazeInfo LLVMMC LLVMSelectionDAG
> LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMMBlazeDesc LLVMMBlazeInfo LLVMMC LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMMBlazeDisassembler LLVMMBlazeCodeGen LLVMMBlazeDesc
> LLVMMBlazeInfo LLVMMC)
> > -set(MSVC_LIB_DEPS_LLVMMBlazeInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMMBlazeInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMMC LLVMSupport)
> > -set(MSVC_LIB_DEPS_LLVMMCDisassembler LLVMARMAsmParser LLVMARMCodeGen
> LLVMARMDesc LLVMARMDisassembler LLVMARMInfo LLVMAlphaCodeGen LLVMAlphaDesc
> LLVMAlphaInfo LLVMBlackfinCodeGen LLVMBlackfinDesc LLVMBlackfinInfo
> LLVMCBackend LLVMCBackendInfo LLVMCellSPUCodeGen LLVMCellSPUDesc
> LLVMCellSPUInfo LLVMCppBackend LLVMCppBackendInfo LLVMMBlazeAsmParser
> LLVMMBlazeCodeGen LLVMMBlazeDesc LLVMMBlazeDisassembler LLVMMBlazeInfo
> LLVMMC LLVMMCParser LLVMMSP430CodeGen LLVMMSP430Desc LLVMMSP430Info
> LLVMMipsCodeGen LLVMMipsDesc LLVMMipsInfo LLVMPTXCodeGen LLVMPTXDesc
> LLVMPTXInfo LLVMPowerPCCodeGen LLVMPowerPCDesc LLVMPowerPCInfo
> LLVMSparcCodeGen LLVMSparcDesc LLVMSparcInfo LLVMSupport LLVMSystemZCodeGen
> LLVMSystemZDesc LLVMSystemZInfo LLVMX86AsmParser LLVMX86CodeGen LLVMX86Desc
> LLVMX86Disassembler LLVMX86Info LLVMXCoreCodeGen LLVMXCoreDesc
> LLVMXCoreInfo)
> > +set(MSVC_LIB_DEPS_LLVMMCDisassembler LLVMARMAsmParser LLVMARMCodeGen
> LLVMARMDesc LLVMARMDisassembler LLVMARMInfo LLVMAlphaCodeGen LLVMAlphaDesc
> LLVMAlphaInfo LLVMBlackfinCodeGen LLVMBlackfinDesc LLVMBlackfinInfo
> LLVMCBackend LLVMCBackendInfo LLVMCellSPUCodeGen LLVMCellSPUDesc
> LLVMCellSPUInfo LLVMCppBackend LLVMCppBackendInfo LLVMMBlazeAsmParser
> LLVMMBlazeCodeGen LLVMMBlazeDesc LLVMMBlazeDisassembler LLVMMBlazeInfo
> LLVMMC LLVMMCParser LLVMMSP430CodeGen LLVMMSP430Desc LLVMMSP430Info
> LLVMMipsCodeGen LLVMMipsDesc LLVMMipsInfo LLVMPTXCodeGen LLVMPTXDesc
> LLVMPTXInfo LLVMPowerPCCodeGen LLVMPowerPCDesc LLVMPowerPCInfo
> LLVMSparcCodeGen LLVMSparcDesc LLVMSparcInfo LLVMSupport LLVMSystemZCodeGen
> LLVMSystemZDesc LLVMSystemZInfo LLVMTarget LLVMX86AsmParser LLVMX86CodeGen
> LLVMX86Desc LLVMX86Disassembler LLVMX86Info LLVMXCoreCodeGen LLVMXCoreDesc
> LLVMXCoreInfo)
> > set(MSVC_LIB_DEPS_LLVMMCJIT LLVMCore LLVMExecutionEngine LLVMRuntimeDyld
> LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMMCParser LLVMMC LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMMC LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMMSP430CodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore
> LLVMMC LLVMMSP430AsmPrinter LLVMMSP430Desc LLVMMSP430Info LLVMSelectionDAG
> LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMMSP430Desc LLVMMC LLVMMSP430Info)
> > -set(MSVC_LIB_DEPS_LLVMMSP430Info LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMMSP430Info LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMMC LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMMipsCodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore
> LLVMMC LLVMMipsAsmPrinter LLVMMipsDesc LLVMMipsInfo LLVMSelectionDAG
> LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMMipsDesc LLVMMC LLVMMipsInfo LLVMSupport)
> > -set(MSVC_LIB_DEPS_LLVMMipsInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMMipsInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMObject LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMPTXCodeGen LLVMAnalysis LLVMAsmPrinter LLVMCodeGen
> LLVMCore LLVMMC LLVMPTXDesc LLVMPTXInfo LLVMSelectionDAG LLVMSupport
> LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMPTXDesc LLVMMC LLVMPTXInfo LLVMSupport)
> > -set(MSVC_LIB_DEPS_LLVMPTXInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMPTXInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMMC LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMPowerPCCodeGen LLVMAnalysis LLVMAsmPrinter
> LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCAsmPrinter LLVMPowerPCDesc
> LLVMPowerPCInfo LLVMSelectionDAG LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMPowerPCDesc LLVMMC LLVMPowerPCInfo LLVMSupport)
> > -set(MSVC_LIB_DEPS_LLVMPowerPCInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMPowerPCInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMRuntimeDyld LLVMObject LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMScalarOpts LLVMAnalysis LLVMCore LLVMInstCombine
> LLVMSupport LLVMTarget LLVMTransformUtils)
> > set(MSVC_LIB_DEPS_LLVMSelectionDAG LLVMAnalysis LLVMCodeGen LLVMCore
> LLVMMC LLVMSupport LLVMTarget LLVMTransformUtils)
> > set(MSVC_LIB_DEPS_LLVMSparcCodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore
> LLVMMC LLVMSelectionDAG LLVMSparcDesc LLVMSparcInfo LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMSparcDesc LLVMMC LLVMSparcInfo LLVMSupport)
> > -set(MSVC_LIB_DEPS_LLVMSparcInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMSparcInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMSupport )
> > set(MSVC_LIB_DEPS_LLVMSystemZCodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore
> LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystemZDesc LLVMSystemZInfo
> LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMSystemZDesc LLVMMC LLVMSystemZInfo)
> > -set(MSVC_LIB_DEPS_LLVMSystemZInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMSystemZInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMTarget LLVMCore LLVMMC LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMTransformUtils LLVMAnalysis LLVMCore LLVMSupport
> LLVMTarget LLVMipa)
> > set(MSVC_LIB_DEPS_LLVMX86AsmParser LLVMMC LLVMMCParser LLVMSupport
> LLVMTarget LLVMX86Info)
> > @@ -74,10 +74,10 @@
> > set(MSVC_LIB_DEPS_LLVMX86CodeGen LLVMAnalysis LLVMAsmPrinter LLVMCodeGen
> LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget LLVMX86AsmPrinter
> LLVMX86Desc LLVMX86Info LLVMX86Utils)
> > set(MSVC_LIB_DEPS_LLVMX86Desc LLVMMC LLVMSupport LLVMX86Info)
> > set(MSVC_LIB_DEPS_LLVMX86Disassembler LLVMMC LLVMSupport LLVMX86Info)
> > -set(MSVC_LIB_DEPS_LLVMX86Info LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMX86Info LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMX86Utils LLVMCore LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMXCoreCodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore
> LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget LLVMXCoreDesc LLVMXCoreInfo)
> > set(MSVC_LIB_DEPS_LLVMXCoreDesc LLVMMC LLVMXCoreInfo)
> > -set(MSVC_LIB_DEPS_LLVMXCoreInfo LLVMMC LLVMSupport)
> > +set(MSVC_LIB_DEPS_LLVMXCoreInfo LLVMMC LLVMSupport LLVMTarget)
> > set(MSVC_LIB_DEPS_LLVMipa LLVMAnalysis LLVMCore LLVMSupport)
> > set(MSVC_LIB_DEPS_LLVMipo LLVMAnalysis LLVMCore LLVMScalarOpts
> LLVMSupport LLVMTarget LLVMTransformUtils LLVMipa)
> >
> > Modified: llvm/trunk/lib/Support/CMakeLists.txt
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CMakeLists.txt?rev=135760&r1=135759&r2=135760&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Support/CMakeLists.txt (original)
> > +++ llvm/trunk/lib/Support/CMakeLists.txt Fri Jul 22 03:16:53 2011
> > @@ -42,7 +42,6 @@
> > StringPool.cpp
> > StringRef.cpp
> > SystemUtils.cpp
> > - TargetRegistry.cpp
> > Timer.cpp
> > ToolOutputFile.cpp
> > Triple.cpp
> >
> > Removed: llvm/trunk/lib/Support/TargetRegistry.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/TargetRegistry.cpp?rev=135759&view=auto
> >
> ==============================================================================
> > --- llvm/trunk/lib/Support/TargetRegistry.cpp (original)
> > +++ llvm/trunk/lib/Support/TargetRegistry.cpp (removed)
> > @@ -1,122 +0,0 @@
> > -//===--- TargetRegistry.cpp - Target registration
> -------------------------===//
> > -//
> > -// The LLVM Compiler Infrastructure
> > -//
> > -// This file is distributed under the University of Illinois Open Source
> > -// License. See LICENSE.TXT for details.
> > -//
> >
> -//===----------------------------------------------------------------------===//
> > -
> > -#include "llvm/ADT/STLExtras.h"
> > -#include "llvm/ADT/StringRef.h"
> > -#include "llvm/Target/TargetRegistry.h"
> > -#include "llvm/Support/Host.h"
> > -#include "llvm/Support/raw_ostream.h"
> > -#include <cassert>
> > -#include <vector>
> > -using namespace llvm;
> > -
> > -// Clients are responsible for avoid race conditions in registration.
> > -static Target *FirstTarget = 0;
> > -
> > -TargetRegistry::iterator TargetRegistry::begin() {
> > - return iterator(FirstTarget);
> > -}
> > -
> > -const Target *TargetRegistry::lookupTarget(const std::string &TT,
> > - std::string &Error) {
> > - // Provide special warning when no targets are initialized.
> > - if (begin() == end()) {
> > - Error = "Unable to find target for this triple (no targets are
> registered)";
> > - return 0;
> > - }
> > - const Target *Best = 0, *EquallyBest = 0;
> > - unsigned BestQuality = 0;
> > - for (iterator it = begin(), ie = end(); it != ie; ++it) {
> > - if (unsigned Qual = it->TripleMatchQualityFn(TT)) {
> > - if (!Best || Qual > BestQuality) {
> > - Best = &*it;
> > - EquallyBest = 0;
> > - BestQuality = Qual;
> > - } else if (Qual == BestQuality)
> > - EquallyBest = &*it;
> > - }
> > - }
> > -
> > - if (!Best) {
> > - Error = "No available targets are compatible with this triple, "
> > - "see -version for the available targets.";
> > - return 0;
> > - }
> > -
> > - // Otherwise, take the best target, but make sure we don't have two
> equally
> > - // good best targets.
> > - if (EquallyBest) {
> > - Error = std::string("Cannot choose between targets \"") +
> > - Best->Name + "\" and \"" + EquallyBest->Name + "\"";
> > - return 0;
> > - }
> > -
> > - return Best;
> > -}
> > -
> > -void TargetRegistry::RegisterTarget(Target &T,
> > - const char *Name,
> > - const char *ShortDesc,
> > - Target::TripleMatchQualityFnTy
> TQualityFn,
> > - bool HasJIT) {
> > - assert(Name && ShortDesc && TQualityFn &&
> > - "Missing required target information!");
> > -
> > - // Check if this target has already been initialized, we allow this as
> a
> > - // convenience to some clients.
> > - if (T.Name)
> > - return;
> > -
> > - // Add to the list of targets.
> > - T.Next = FirstTarget;
> > - FirstTarget = &T;
> > -
> > - T.Name = Name;
> > - T.ShortDesc = ShortDesc;
> > - T.TripleMatchQualityFn = TQualityFn;
> > - T.HasJIT = HasJIT;
> > -}
> > -
> > -const Target *TargetRegistry::getClosestTargetForJIT(std::string &Error)
> {
> > - const Target *TheTarget = lookupTarget(sys::getHostTriple(), Error);
> > -
> > - if (TheTarget && !TheTarget->hasJIT()) {
> > - Error = "No JIT compatible target available for this host";
> > - return 0;
> > - }
> > -
> > - return TheTarget;
> > -}
> > -
> > -static int TargetArraySortFn(const void *LHS, const void *RHS) {
> > - typedef std::pair<StringRef, const Target*> pair_ty;
> > - return ((const pair_ty*)LHS)->first.compare(((const
> pair_ty*)RHS)->first);
> > -}
> > -
> > -void TargetRegistry::printRegisteredTargetsForVersion() {
> > - std::vector<std::pair<StringRef, const Target*> > Targets;
> > - size_t Width = 0;
> > - for (TargetRegistry::iterator I = TargetRegistry::begin(),
> > - E = TargetRegistry::end();
> > - I != E; ++I) {
> > - Targets.push_back(std::make_pair(I->getName(), &*I));
> > - Width = std::max(Width, Targets.back().first.size());
> > - }
> > - array_pod_sort(Targets.begin(), Targets.end(), TargetArraySortFn);
> > -
> > - raw_ostream &OS = outs();
> > - OS << " Registered Targets:\n";
> > - for (unsigned i = 0, e = Targets.size(); i != e; ++i) {
> > - OS << " " << Targets[i].first;
> > - OS.indent(Width - Targets[i].first.size()) << " - "
> > - << Targets[i].second->getShortDescription() << '\n';
> > - }
> > - if (Targets.empty())
> > - OS << " (none)\n";
> > -}
> >
> > Modified: llvm/trunk/lib/Target/CMakeLists.txt
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CMakeLists.txt?rev=135760&r1=135759&r2=135760&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/CMakeLists.txt (original)
> > +++ llvm/trunk/lib/Target/CMakeLists.txt Fri Jul 22 03:16:53 2011
> > @@ -11,6 +11,7 @@
> > TargetLoweringObjectFile.cpp
> > TargetMachine.cpp
> > TargetRegisterInfo.cpp
> > + TargetRegistry.cpp
> > TargetSubtargetInfo.cpp
> > )
> >
> >
> > Copied: llvm/trunk/lib/Target/TargetRegistry.cpp (from r135759,
> llvm/trunk/lib/Support/TargetRegistry.cpp)
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetRegistry.cpp?p2=llvm/trunk/lib/Target/TargetRegistry.cpp&p1=llvm/trunk/lib/Support/TargetRegistry.cpp&r1=135759&r2=135760&rev=135760&view=diff
> >
> ==============================================================================
> > (empty)
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110726/7e8dc4c6/attachment.html>
More information about the llvm-commits
mailing list