blob: 271a2bf653a6e4539985f91618e8dcb640db2e6e [file] [log] [blame]
Chris Lattnerf31182a2004-02-13 23:18:48 +00001//===-- CTargetMachine.h - TargetMachine for the C backend ------*- C++ -*-===//
Misha Brukmand6a29a52005-04-20 16:05:03 +00002//
Chris Lattnerf31182a2004-02-13 23:18:48 +00003// The LLVM Compiler Infrastructure
4//
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.
Misha Brukmand6a29a52005-04-20 16:05:03 +00007//
Chris Lattnerf31182a2004-02-13 23:18:48 +00008//===----------------------------------------------------------------------===//
Misha Brukmand6a29a52005-04-20 16:05:03 +00009//
Chris Lattnerf31182a2004-02-13 23:18:48 +000010// This file declares the TargetMachine that is used by the C backend.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef CTARGETMACHINE_H
15#define CTARGETMACHINE_H
16
17#include "llvm/Target/TargetMachine.h"
18
19namespace llvm {
Chris Lattnerf31182a2004-02-13 23:18:48 +000020
21struct CTargetMachine : public TargetMachine {
Owen Andersona69571c2006-05-03 01:29:57 +000022 const TargetData DataLayout; // Calculates type size & alignment
23
Chris Lattnerbc641b92006-03-23 05:43:16 +000024 CTargetMachine(const Module &M, const std::string &FS)
Owen Andersona69571c2006-05-03 01:29:57 +000025 : TargetMachine("CBackend", M),
26 DataLayout("CBackend") {}
Chris Lattnerf31182a2004-02-13 23:18:48 +000027
Chris Lattnerf31182a2004-02-13 23:18:48 +000028 // This is the only thing that actually does anything here.
Chris Lattner0431c962005-06-25 02:48:37 +000029 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
Chris Lattnerce8eb0c2005-11-08 02:11:51 +000030 CodeGenFileType FileType, bool Fast);
Chris Lattnerd36c9702004-07-11 02:48:49 +000031
32 // This class always works, but shouldn't be the default in most cases.
33 static unsigned getModuleMatchQuality(const Module &M) { return 1; }
Owen Andersona69571c2006-05-03 01:29:57 +000034
35 virtual const TargetData *getTargetData() const { return &DataLayout; }
Chris Lattnerf31182a2004-02-13 23:18:48 +000036};
37
38} // End llvm namespace
39
40
41#endif