blob: 4bae7f817543d723bae749ccb6143e84453ebd82 [file] [log] [blame]
Anton Korobeynikov78695032008-04-23 22:29:24 +00001//===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- C++ -*-===//
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//
10// This file declares the TargetMachine that is used by the C++ backend.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_CPPBACKEND_CPPTARGETMACHINE_H
15#define LLVM_LIB_TARGET_CPPBACKEND_CPPTARGETMACHINE_H
Anton Korobeynikov78695032008-04-23 22:29:24 +000016
Chandler Carruth9fb823b2013-01-02 11:36:10 +000017#include "llvm/IR/DataLayout.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000018#include "llvm/Target/TargetMachine.h"
Eric Christophereba91672014-08-04 16:40:55 +000019#include "llvm/Target/TargetSubtargetInfo.h"
Anton Korobeynikov78695032008-04-23 22:29:24 +000020
21namespace llvm {
22
David Greenea31f96c2009-07-14 20:18:05 +000023class formatted_raw_ostream;
Owen Anderson93719642008-08-21 00:14:44 +000024
Eric Christophereba91672014-08-04 16:40:55 +000025class CPPSubtarget : public TargetSubtargetInfo {
26};
27
Anton Korobeynikov78695032008-04-23 22:29:24 +000028struct CPPTargetMachine : public TargetMachine {
Evan Cheng2129f592011-07-19 06:37:02 +000029 CPPTargetMachine(const Target &T, StringRef TT,
Nick Lewycky50f02cb2011-12-02 22:16:29 +000030 StringRef CPU, StringRef FS, const TargetOptions &Options,
Evan Chengecb29082011-11-16 08:38:26 +000031 Reloc::Model RM, CodeModel::Model CM,
32 CodeGenOpt::Level OL)
Eric Christophereba91672014-08-04 16:40:55 +000033 : TargetMachine(T, TT, CPU, FS, Options), Subtarget() {}
34private:
35 CPPSubtarget Subtarget;
Anton Korobeynikov78695032008-04-23 22:29:24 +000036
Eric Christophereba91672014-08-04 16:40:55 +000037public:
38 const CPPSubtarget *getSubtargetImpl() const override { return &Subtarget; }
Craig Topper9d74a5a2014-04-29 07:58:41 +000039 bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out,
40 CodeGenFileType FileType, bool DisableVerify,
41 AnalysisID StartAfter,
42 AnalysisID StopAfter) override;
Anton Korobeynikov78695032008-04-23 22:29:24 +000043};
44
Daniel Dunbar67038c12009-07-18 23:03:22 +000045extern Target TheCppBackendTarget;
46
Anton Korobeynikov78695032008-04-23 22:29:24 +000047} // End llvm namespace
48
49
50#endif