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 | 2c836cf1870cada5c09c69b6b35a9b5d3aca5e8f (patch) | |
tree | 3dc90c89c7afe8506b10368f93ba0d543824d7f6 /llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp | |
parent | e4ac7a40595365f55dca86e05a3dce6ff467e0ce (diff) | |
download | bcm5719-llvm-2c836cf1870cada5c09c69b6b35a9b5d3aca5e8f.tar.gz bcm5719-llvm-2c836cf1870cada5c09c69b6b35a9b5d3aca5e8f.zip |
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.
llvm-svn: 57016
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp')
-rw-r--r-- | llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp index 4a3ca7fa066..d7aa08f8ca6 100644 --- a/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -29,14 +29,12 @@ using namespace llvm; /// namespace { class SparcDAGToDAGISel : public SelectionDAGISel { - SparcTargetLowering Lowering; - /// Subtarget - Keep a pointer to the Sparc Subtarget around so that we can /// make the right decision when generating code for different targets. const SparcSubtarget &Subtarget; public: - explicit SparcDAGToDAGISel(TargetMachine &TM) - : SelectionDAGISel(Lowering), Lowering(TM), + explicit SparcDAGToDAGISel(SparcTargetMachine &TM) + : SelectionDAGISel(*TM.getTargetLowering()), Subtarget(TM.getSubtarget<SparcSubtarget>()) { } @@ -189,6 +187,6 @@ SDNode *SparcDAGToDAGISel::Select(SDValue Op) { /// createSparcISelDag - This pass converts a legalized DAG into a /// SPARC-specific DAG, ready for instruction scheduling. /// -FunctionPass *llvm::createSparcISelDag(TargetMachine &TM) { +FunctionPass *llvm::createSparcISelDag(SparcTargetMachine &TM) { return new SparcDAGToDAGISel(TM); } |