diff options
author | Dan Gohman <gohman@apple.com> | 2008-10-03 16:55:19 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-10-03 16:55:19 +0000 |
commit | da8ac5fd9130b70b61be61e4819faa8d842d708f (patch) | |
tree | f5cd677e4925c97b3acedfa9cb18693a5429a162 /lib/Target/X86 | |
parent | 38217fef57de72064ba74a165cf100d785dfcad0 (diff) | |
download | external_llvm-da8ac5fd9130b70b61be61e4819faa8d842d708f.zip external_llvm-da8ac5fd9130b70b61be61e4819faa8d842d708f.tar.gz external_llvm-da8ac5fd9130b70b61be61e4819faa8d842d708f.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/X86')
-rw-r--r-- | lib/Target/X86/X86ISelDAGToDAG.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 06dfc21..35c5b42 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -113,7 +113,7 @@ namespace { /// X86Lowering - This object fully describes how to lower LLVM code to an /// X86-specific SelectionDAG. - X86TargetLowering X86Lowering; + X86TargetLowering &X86Lowering; /// Subtarget - Keep a pointer to the X86Subtarget around so that we can /// make the right decision when generating code for different targets. @@ -129,7 +129,7 @@ namespace { public: X86DAGToDAGISel(X86TargetMachine &tm, bool fast) - : SelectionDAGISel(X86Lowering, fast), + : SelectionDAGISel(*tm.getTargetLowering(), fast), TM(tm), X86Lowering(*TM.getTargetLowering()), Subtarget(&TM.getSubtarget<X86Subtarget>()), OptForSize(false) {} |