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
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 6d66839..02646de 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -367,11 +367,11 @@
 }
 
 unsigned MachineJumpTableInfo::getEntrySize() const { 
-  return TD.getPointerSize(); 
+  return TD->getPointerSize(); 
 }
 
 unsigned MachineJumpTableInfo::getAlignment() const { 
-  return TD.getPointerAlignment(); 
+  return TD->getPointerAlignment(); 
 }
 
 void MachineJumpTableInfo::dump() const { print(std::cerr); }
@@ -400,7 +400,7 @@
   unsigned Offset = 0;
   if (!Constants.empty()) {
     Offset = Constants.back().Offset;
-    Offset += TD.getTypeSize(Constants.back().Val->getType());
+    Offset += TD->getTypeSize(Constants.back().Val->getType());
     Offset = (Offset+AlignMask)&~AlignMask;
   }