diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
commit | 009b1c42aa6266385f2c37e227516b24077e6dd7 (patch) | |
tree | 64ba909838c23261cace781ece27d106134ea451 /lib/Target/CppBackend/CPPTargetMachine.h | |
download | src-009b1c42aa6266385f2c37e227516b24077e6dd7.tar.gz src-009b1c42aa6266385f2c37e227516b24077e6dd7.zip |
Import LLVM, at r72732.vendor/llvm/llvm-r72732
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=193323
svn path=/vendor/llvm/llvm-r72732/; revision=193324; tag=vendor/llvm/llvm-r72732
Diffstat (limited to 'lib/Target/CppBackend/CPPTargetMachine.h')
-rw-r--r-- | lib/Target/CppBackend/CPPTargetMachine.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/Target/CppBackend/CPPTargetMachine.h b/lib/Target/CppBackend/CPPTargetMachine.h new file mode 100644 index 000000000000..db4bc0e722c8 --- /dev/null +++ b/lib/Target/CppBackend/CPPTargetMachine.h @@ -0,0 +1,44 @@ +//===-- 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 { + +class raw_ostream; + +struct CPPTargetMachine : public TargetMachine { + const TargetData DataLayout; // Calculates type size & alignment + + CPPTargetMachine(const Module &M, const std::string &FS) + : DataLayout(&M) {} + + virtual bool WantsWholeFile() const { return true; } + virtual bool addPassesToEmitWholeFile(PassManager &PM, raw_ostream &Out, + CodeGenFileType FileType, + CodeGenOpt::Level OptLevel); + + // This class always works, but shouldn't be the default in most cases. + static unsigned getModuleMatchQuality(const Module &M) { return 1; } + + virtual const TargetData *getTargetData() const { return &DataLayout; } +}; + +} // End llvm namespace + + +#endif |