1 //===-- ARMTargetMachine.cpp - Define TargetMachine for ARM ---------------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the "Instituto Nokia de Tecnologia" and
6 // is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 #include "ARMTargetAsmInfo.h"
15 #include "ARMTargetMachine.h"
16 #include "ARMFrameInfo.h"
18 #include "llvm/Module.h"
19 #include "llvm/PassManager.h"
20 #include "llvm/Target/TargetMachineRegistry.h"
24 // Register the target.
25 RegisterTarget<ARMTargetMachine> X("arm", " ARM");
29 const TargetAsmInfo *ARMTargetMachine::createTargetAsmInfo() const {
30 return new ARMTargetAsmInfo(*this);
34 /// TargetMachine ctor - Create an ILP32 architecture model
36 ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS)
37 : DataLayout("E-p:32:32") {
40 unsigned ARMTargetMachine::getModuleMatchQuality(const Module &M) {
41 std::string TT = M.getTargetTriple();
42 if (TT.size() >= 4 && std::string(TT.begin(), TT.begin()+4) == "arm-")
45 if (M.getPointerSize() == Module::Pointer32)
52 // Pass Pipeline Configuration
53 bool ARMTargetMachine::addInstSelector(FunctionPassManager &PM, bool Fast) {
54 PM.add(createARMISelDag(*this));
58 bool ARMTargetMachine::addPostRegAlloc(FunctionPassManager &PM, bool Fast) {
59 PM.add(createARMFixMulPass());
63 bool ARMTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
65 // Output assembly language.
66 PM.add(createARMCodePrinterPass(Out, *this));