diff options
author | Owen Anderson <resistor@mac.com> | 2006-05-03 01:29:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2006-05-03 01:29:57 +0000 |
commit | a69571c7991813c93cba64e88eced6899ce93d81 (patch) | |
tree | 06bc81338c35527b69a6e8e7434e7c1a824bc4ca /lib/Target/CBackend/CTargetMachine.h | |
parent | 0eb4d6b52e1b5db9a4c86e5a954356ae3507a287 (diff) |
Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/CTargetMachine.h')
-rw-r--r-- | lib/Target/CBackend/CTargetMachine.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/CBackend/CTargetMachine.h b/lib/Target/CBackend/CTargetMachine.h index f947f650c6..271a2bf653 100644 --- a/lib/Target/CBackend/CTargetMachine.h +++ b/lib/Target/CBackend/CTargetMachine.h @@ -19,8 +19,11 @@ namespace llvm { struct CTargetMachine : public TargetMachine { + const TargetData DataLayout; // Calculates type size & alignment + CTargetMachine(const Module &M, const std::string &FS) - : TargetMachine("CBackend", M) {} + : TargetMachine("CBackend", M), + DataLayout("CBackend") {} // This is the only thing that actually does anything here. virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, @@ -28,6 +31,8 @@ struct CTargetMachine : public TargetMachine { // 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 |