1 //===-- XCoreTargetMachine.cpp - Define TargetMachine for XCore -----------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 #include "XCoreMCAsmInfo.h"
14 #include "XCoreTargetMachine.h"
16 #include "llvm/Module.h"
17 #include "llvm/PassManager.h"
18 #include "llvm/Target/TargetRegistry.h"
21 /// XCoreTargetMachine ctor - Create an ILP32 architecture model
23 XCoreTargetMachine::XCoreTargetMachine(const Target
&T
, const std::string
&TT
,
24 const std::string
&FS
)
25 : LLVMTargetMachine(T
, TT
),
27 DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-"
28 "i16:16:32-i32:32:32-i64:32:32-n32"),
30 FrameLowering(Subtarget
),
35 bool XCoreTargetMachine::addInstSelector(PassManagerBase
&PM
,
36 CodeGenOpt::Level OptLevel
) {
37 PM
.add(createXCoreISelDag(*this));
41 // Force static initialization.
42 extern "C" void LLVMInitializeXCoreTarget() {
43 RegisterTargetMachine
<XCoreTargetMachine
> X(TheXCoreTarget
);
44 RegisterAsmInfo
<XCoreMCAsmInfo
> Y(TheXCoreTarget
);