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 "ARMTargetMachine.h"
15 #include "ARMFrameInfo.h"
17 #include "llvm/Module.h"
18 #include "llvm/PassManager.h"
19 #include "llvm/Target/TargetMachineRegistry.h"
23 // Register the target.
24 RegisterTarget<ARMTargetMachine> X("arm", " ARM");
27 /// TargetMachine ctor - Create an ILP32 architecture model
29 ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS)
30 : DataLayout("E-p:32:32") {
33 unsigned ARMTargetMachine::getModuleMatchQuality(const Module &M) {
34 std::string TT = M.getTargetTriple();
35 if (TT.size() >= 4 && std::string(TT.begin(), TT.begin()+4) == "arm-")
38 if (M.getPointerSize() == Module::Pointer32)
45 // Pass Pipeline Configuration
46 bool ARMTargetMachine::addInstSelector(FunctionPassManager &PM, bool Fast) {
47 PM.add(createARMISelDag(*this));
50 bool ARMTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
52 // Output assembly language.
53 PM.add(createARMCodePrinterPass(Out, *this));