switch to using llvm/Target/TargetSelect.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73611 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-06-17 16:42:19 +00:00
parent 5f1a5c7f57
commit 2deb58f72e
3 changed files with 12 additions and 25 deletions

View File

@ -38,8 +38,7 @@
#include "llvm/System/Signals.h" #include "llvm/System/Signals.h"
#include "llvm/Config/config.h" #include "llvm/Config/config.h"
#include "llvm/LinkAllVMCore.h" #include "llvm/LinkAllVMCore.h"
#include "llvm/InitializeAllTargets.h" #include "llvm/Target/TargetSelect.h"
#include "llvm/InitializeAllAsmPrinters.h"
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
@ -216,6 +215,9 @@ int main(int argc, char **argv) {
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n"); cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
InitializeAllTargets();
InitializeAllAsmPrinters();
// Load the module to be compiled... // Load the module to be compiled...
std::string ErrorMessage; std::string ErrorMessage;
std::auto_ptr<Module> M; std::auto_ptr<Module> M;

View File

@ -28,7 +28,7 @@
#include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/PrettyStackTrace.h"
#include "llvm/System/Process.h" #include "llvm/System/Process.h"
#include "llvm/System/Signals.h" #include "llvm/System/Signals.h"
#include "llvm/Config/config.h" #include "llvm/Target/TargetSelect.h"
#include <iostream> #include <iostream>
#include <cerrno> #include <cerrno>
using namespace llvm; using namespace llvm;
@ -85,16 +85,6 @@ static void do_shutdown() {
llvm_shutdown(); llvm_shutdown();
} }
#ifdef LLVM_NATIVE_ARCH
namespace llvm {
#define Declare2(TARG, MOD) void Initialize ## TARG ## MOD()
#define Declare(T, M) Declare2(T, M)
Declare(LLVM_NATIVE_ARCH, Target);
#undef Declare
#undef Declare2
}
#endif
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// main Driver function // main Driver function
// //
@ -149,15 +139,9 @@ int main(int argc, char **argv, char * const *envp) {
case '3': OLvl = CodeGenOpt::Aggressive; break; case '3': OLvl = CodeGenOpt::Aggressive; break;
} }
// If we have a native target, initialize it to ensure it is linked in. // If we have a native target, initialize it to ensure it is linked in and
#ifdef LLVM_NATIVE_ARCH // usable by the JIT.
#define DoInit2(TARG, MOD) llvm::Initialize ## TARG ## MOD() InitializeNativeTarget();
#define DoInit(T, M) DoInit2(T, M)
DoInit(LLVM_NATIVE_ARCH, Target);
#undef DoInit
#undef DoInit2
#endif
EE = ExecutionEngine::create(MP, ForceInterpreter, &ErrorMsg, OLvl); EE = ExecutionEngine::create(MP, ForceInterpreter, &ErrorMsg, OLvl);
if (!EE && !ErrorMsg.empty()) { if (!EE && !ErrorMsg.empty()) {

View File

@ -18,8 +18,6 @@
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
#include "llvm/InitializeAllTargets.h"
#include "llvm/InitializeAllAsmPrinters.h"
#include "llvm/Linker.h" #include "llvm/Linker.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/ModuleProvider.h" #include "llvm/ModuleProvider.h"
@ -39,10 +37,11 @@
#include "llvm/System/Signals.h" #include "llvm/System/Signals.h"
#include "llvm/Target/SubtargetFeature.h" #include "llvm/Target/SubtargetFeature.h"
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetSelect.h"
#include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Scalar.h"
#include "llvm/Config/config.h" #include "llvm/Config/config.h"
@ -76,6 +75,8 @@ LTOCodeGenerator::LTOCodeGenerator()
_codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC), _codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
_nativeObjectFile(NULL), _gccPath(NULL), _assemblerPath(NULL) _nativeObjectFile(NULL), _gccPath(NULL), _assemblerPath(NULL)
{ {
InitializeAllTargets();
InitializeAllAsmPrinters();
} }