OLD | NEW |
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// | 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 return nullptr; | 106 return nullptr; |
107 } | 107 } |
108 | 108 |
109 TargetLowering::TargetLowering(Cfg *Func) | 109 TargetLowering::TargetLowering(Cfg *Func) |
110 : Func(Func), Ctx(Func->getContext()), Context() {} | 110 : Func(Func), Ctx(Func->getContext()), Context() {} |
111 | 111 |
112 std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target, | 112 std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target, |
113 Cfg *Func) { | 113 Cfg *Func) { |
114 #define SUBZERO_TARGET(X) \ | 114 #define SUBZERO_TARGET(X) \ |
115 if (Target == Target_##X) \ | 115 if (Target == Target_##X) \ |
116 return std::unique_ptr<Assembler>(new X::Assembler##X()); | 116 return std::unique_ptr<Assembler>(new X::Assembler##X(Func->getContext())); |
117 #include "llvm/Config/SZTargets.def" | 117 #include "llvm/Config/SZTargets.def" |
118 | 118 |
119 Func->setError("Unsupported target assembler"); | 119 Func->setError("Unsupported target assembler"); |
120 return nullptr; | 120 return nullptr; |
121 } | 121 } |
122 | 122 |
123 void TargetLowering::doAddressOpt() { | 123 void TargetLowering::doAddressOpt() { |
124 if (llvm::isa<InstLoad>(*Context.getCur())) | 124 if (llvm::isa<InstLoad>(*Context.getCur())) |
125 doAddressOptLoad(); | 125 doAddressOptLoad(); |
126 else if (llvm::isa<InstStore>(*Context.getCur())) | 126 else if (llvm::isa<InstStore>(*Context.getCur())) |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 if (Target == Target_##X) \ | 620 if (Target == Target_##X) \ |
621 return TargetHeader##X::create(Ctx); | 621 return TargetHeader##X::create(Ctx); |
622 #include "llvm/Config/SZTargets.def" | 622 #include "llvm/Config/SZTargets.def" |
623 | 623 |
624 llvm::report_fatal_error("Unsupported target header lowering"); | 624 llvm::report_fatal_error("Unsupported target header lowering"); |
625 } | 625 } |
626 | 626 |
627 TargetHeaderLowering::~TargetHeaderLowering() = default; | 627 TargetHeaderLowering::~TargetHeaderLowering() = default; |
628 | 628 |
629 } // end of namespace Ice | 629 } // end of namespace Ice |
OLD | NEW |