aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-10-03 16:55:19 +0000
committerDan Gohman <gohman@apple.com>2008-10-03 16:55:19 +0000
commitf2b2957318f841e3a74dba30df70d359675f2915 (patch)
treef5cd677e4925c97b3acedfa9cb18693a5429a162 /lib/Target/PowerPC
parent61ad864855e559ac0f1c1b213adf8a6cadf24b83 (diff)
downloadexternal_llvm-f2b2957318f841e3a74dba30df70d359675f2915.zip
external_llvm-f2b2957318f841e3a74dba30df70d359675f2915.tar.gz
external_llvm-f2b2957318f841e3a74dba30df70d359675f2915.tar.bz2
Avoid creating two TargetLowering objects for each target.
Instead, just create one, and make sure everything that needs it can access it. Previously most of the SelectionDAGISel subclasses all had their own TargetLowering object, which was redundant with the TargetLowering object in the TargetMachine subclasses, except on Sparc, where SparcTargetMachine didn't have a TargetLowering object. Change Sparc to work more like the other targets here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC')
-rw-r--r--lib/Target/PowerPC/PPCISelDAGToDAG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 6b2ec4a..56d6a58 100644
--- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -41,12 +41,12 @@ namespace {
///
class VISIBILITY_HIDDEN PPCDAGToDAGISel : public SelectionDAGISel {
PPCTargetMachine &TM;
- PPCTargetLowering PPCLowering;
+ PPCTargetLowering &PPCLowering;
const PPCSubtarget &PPCSubTarget;
unsigned GlobalBaseReg;
public:
explicit PPCDAGToDAGISel(PPCTargetMachine &tm)
- : SelectionDAGISel(PPCLowering), TM(tm),
+ : SelectionDAGISel(*tm.getTargetLowering()), TM(tm),
PPCLowering(*TM.getTargetLowering()),
PPCSubTarget(*TM.getSubtargetImpl()) {}