pass machinemoduleinfo down into getSymbolForDwarfGlobalReference,
[llvm/avr.git] / lib / Target / Sparc / SparcTargetMachine.cpp
blob3a381151f946e005c521a41a2daf68accaa01461
1 //===-- SparcTargetMachine.cpp - Define TargetMachine for Sparc -----------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
11 //===----------------------------------------------------------------------===//
13 #include "SparcMCAsmInfo.h"
14 #include "SparcTargetMachine.h"
15 #include "Sparc.h"
16 #include "llvm/PassManager.h"
17 #include "llvm/Target/TargetRegistry.h"
18 using namespace llvm;
20 extern "C" void LLVMInitializeSparcTarget() {
21 // Register the target.
22 RegisterTargetMachine<SparcTargetMachine> X(TheSparcTarget);
23 RegisterAsmInfo<SparcELFMCAsmInfo> Y(TheSparcTarget);
27 /// SparcTargetMachine ctor - Create an ILP32 architecture model
28 ///
29 SparcTargetMachine::SparcTargetMachine(const Target &T, const std::string &TT,
30 const std::string &FS)
31 : LLVMTargetMachine(T, TT),
32 DataLayout("E-p:32:32-f128:128:128"),
33 Subtarget(TT, FS), TLInfo(*this), InstrInfo(Subtarget),
34 FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
37 bool SparcTargetMachine::addInstSelector(PassManagerBase &PM,
38 CodeGenOpt::Level OptLevel) {
39 PM.add(createSparcISelDag(*this));
40 return false;
43 /// addPreEmitPass - This pass may be implemented by targets that want to run
44 /// passes immediately before machine code is emitted. This should return
45 /// true if -print-machineinstrs should print out the code after the passes.
46 bool SparcTargetMachine::addPreEmitPass(PassManagerBase &PM,
47 CodeGenOpt::Level OptLevel){
48 PM.add(createSparcFPMoverPass(*this));
49 PM.add(createSparcDelaySlotFillerPass(*this));
50 return true;