1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Define a runOnMachineFunction for the Hexagon AsmPrinter and

use it to initialize the subtarget.

llvm-svn: 227948
This commit is contained in:
Eric Christopher 2015-02-03 06:40:22 +00:00
parent 2ba773b6bd
commit a26193de86
2 changed files with 6 additions and 3 deletions

View File

@ -63,9 +63,7 @@ static cl::opt<bool> AlignCalls(
HexagonAsmPrinter::HexagonAsmPrinter(TargetMachine &TM,
std::unique_ptr<MCStreamer> Streamer)
: AsmPrinter(TM, std::move(Streamer)) {
Subtarget = &TM.getSubtarget<HexagonSubtarget>();
}
: AsmPrinter(TM, std::move(Streamer)), Subtarget(nullptr) {}
void HexagonAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
raw_ostream &O) {

View File

@ -28,6 +28,11 @@ namespace llvm {
explicit HexagonAsmPrinter(TargetMachine &TM,
std::unique_ptr<MCStreamer> Streamer);
bool runOnMachineFunction(MachineFunction &Fn) override {
Subtarget = &Fn.getSubtarget<HexagonSubtarget>();
return AsmPrinter::runOnMachineFunction(Fn);
}
const char *getPassName() const override {
return "Hexagon Assembly Printer";
}