1 //===-- TargetMachine.cpp - General Target Information ---------------------==//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes the general parts of a Target machine.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Target/TargetMachine.h"
15 #include "llvm/Type.h"
16 #include "llvm/CodeGen/IntrinsicLowering.h"
17 #include "Support/CommandLine.h"
20 //---------------------------------------------------------------------------
21 // Command-line options that tend to be useful on more than one back-end.
25 bool PrintMachineCode;
26 bool NoFramePointerElim;
29 cl::opt<bool, true> PrintCode("print-machineinstrs",
30 cl::desc("Print generated machine code"),
31 cl::location(PrintMachineCode), cl::init(false));
34 DisableFPElim("disable-fp-elim",
35 cl::desc("Disable frame pointer elimination optimization"),
36 cl::location(NoFramePointerElim),
40 //---------------------------------------------------------------------------
41 // TargetMachine Class
43 TargetMachine::TargetMachine(const std::string &name, IntrinsicLowering *il,
45 unsigned char PtrSize, unsigned char PtrAl,
46 unsigned char DoubleAl, unsigned char FloatAl,
47 unsigned char LongAl, unsigned char IntAl,
48 unsigned char ShortAl, unsigned char ByteAl)
49 : Name(name), DataLayout(name, LittleEndian,
50 PtrSize, PtrAl, DoubleAl, FloatAl, LongAl,
51 IntAl, ShortAl, ByteAl) {
52 IL = il ? il : new DefaultIntrinsicLowering();
54 TargetMachine::TargetMachine(const std::string &name, IntrinsicLowering *il,
56 : Name(name), DataLayout(name, &M) {
57 IL = il ? il : new DefaultIntrinsicLowering();
60 TargetMachine::~TargetMachine() {