2008-04-23 22:29:24 +00:00
|
|
|
//===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the TargetMachine that is used by the C++ backend.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef CPPTARGETMACHINE_H
|
|
|
|
#define CPPTARGETMACHINE_H
|
|
|
|
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2009-07-14 20:18:05 +00:00
|
|
|
class formatted_raw_ostream;
|
2008-08-21 00:14:44 +00:00
|
|
|
|
2008-04-23 22:29:24 +00:00
|
|
|
struct CPPTargetMachine : public TargetMachine {
|
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
|
|
|
|
2009-07-15 20:24:03 +00:00
|
|
|
CPPTargetMachine(const Target &T, const Module &M, const std::string &FS)
|
|
|
|
: TargetMachine(T), DataLayout(&M) {}
|
2008-04-23 22:29:24 +00:00
|
|
|
|
|
|
|
virtual bool WantsWholeFile() const { return true; }
|
2009-07-14 20:18:05 +00:00
|
|
|
virtual bool addPassesToEmitWholeFile(PassManager &PM,
|
|
|
|
formatted_raw_ostream &Out,
|
2009-04-29 00:15:41 +00:00
|
|
|
CodeGenFileType FileType,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-04-23 22:29:24 +00:00
|
|
|
|
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
|
|
|
};
|
|
|
|
|
2009-07-18 23:03:22 +00:00
|
|
|
extern Target TheCppBackendTarget;
|
|
|
|
|
2008-04-23 22:29:24 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|