OLD | NEW |
1 //===-- MipsAsmPrinter.cpp - Mips LLVM Assembly Printer -------------------===// | 1 //===-- MipsAsmPrinter.cpp - Mips LLVM Assembly Printer -------------------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
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 // This file contains a printer that converts from our internal representation | 10 // This file contains a printer that converts from our internal representation |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "llvm/CodeGen/MachineFrameInfo.h" | 27 #include "llvm/CodeGen/MachineFrameInfo.h" |
28 #include "llvm/CodeGen/MachineFunctionPass.h" | 28 #include "llvm/CodeGen/MachineFunctionPass.h" |
29 #include "llvm/CodeGen/MachineInstr.h" | 29 #include "llvm/CodeGen/MachineInstr.h" |
30 #include "llvm/CodeGen/MachineMemOperand.h" | 30 #include "llvm/CodeGen/MachineMemOperand.h" |
31 #include "llvm/IR/BasicBlock.h" | 31 #include "llvm/IR/BasicBlock.h" |
32 #include "llvm/IR/DataLayout.h" | 32 #include "llvm/IR/DataLayout.h" |
33 #include "llvm/IR/InlineAsm.h" | 33 #include "llvm/IR/InlineAsm.h" |
34 #include "llvm/IR/Instructions.h" | 34 #include "llvm/IR/Instructions.h" |
35 #include "llvm/MC/MCAsmInfo.h" | 35 #include "llvm/MC/MCAsmInfo.h" |
36 #include "llvm/MC/MCInst.h" | 36 #include "llvm/MC/MCInst.h" |
| 37 #include "llvm/MC/MCNaCl.h" |
37 #include "llvm/MC/MCStreamer.h" | 38 #include "llvm/MC/MCStreamer.h" |
38 #include "llvm/MC/MCSymbol.h" | 39 #include "llvm/MC/MCSymbol.h" |
39 #include "llvm/Support/ELF.h" | 40 #include "llvm/Support/ELF.h" |
40 #include "llvm/Support/TargetRegistry.h" | 41 #include "llvm/Support/TargetRegistry.h" |
41 #include "llvm/Support/raw_ostream.h" | 42 #include "llvm/Support/raw_ostream.h" |
42 #include "llvm/Target/Mangler.h" | 43 #include "llvm/Target/Mangler.h" |
43 #include "llvm/Target/TargetLoweringObjectFile.h" | 44 #include "llvm/Target/TargetLoweringObjectFile.h" |
44 #include "llvm/Target/TargetOptions.h" | 45 #include "llvm/Target/TargetOptions.h" |
45 | 46 |
46 using namespace llvm; | 47 using namespace llvm; |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 else | 562 else |
562 OutStreamer.EmitRawText(StringRef("\t.section .gcc_compiled_long64")); | 563 OutStreamer.EmitRawText(StringRef("\t.section .gcc_compiled_long64")); |
563 } | 564 } |
564 } | 565 } |
565 | 566 |
566 // return to previous section | 567 // return to previous section |
567 if (OutStreamer.hasRawTextSupport()) | 568 if (OutStreamer.hasRawTextSupport()) |
568 OutStreamer.EmitRawText(StringRef("\t.previous")); | 569 OutStreamer.EmitRawText(StringRef("\t.previous")); |
569 | 570 |
570 // @LOCALMOD-START | 571 // @LOCALMOD-START |
571 if (Subtarget->isTargetNaCl() && OutStreamer.hasRawTextSupport()) { | 572 if (Subtarget->isTargetNaCl()) { |
572 std::string str; | 573 if (OutStreamer.hasRawTextSupport()) { |
573 raw_string_ostream OS(str); | 574 std::string str; |
574 EmitMipsSFIHeaders(OS); | 575 raw_string_ostream OS(str); |
575 OutStreamer.EmitRawText(StringRef(OS.str())); | 576 EmitMipsSFIHeaders(OS); |
| 577 OutStreamer.EmitRawText(StringRef(OS.str())); |
| 578 } |
| 579 initializeNaClMCStreamer(OutStreamer, OutContext, |
| 580 Triple(Subtarget->getTargetTriple())); |
576 } | 581 } |
577 // @LOCALMOD-END | 582 // @LOCALMOD-END |
578 } | 583 } |
579 | 584 |
580 // @LOCALMOD-START | 585 // @LOCALMOD-START |
581 unsigned MipsAsmPrinter::GetTargetLabelAlign(const MachineInstr *MI) const { | 586 unsigned MipsAsmPrinter::GetTargetLabelAlign(const MachineInstr *MI) const { |
582 if (Subtarget->isTargetNaCl()) { | 587 if (Subtarget->isTargetNaCl()) { |
583 switch (MI->getOpcode()) { | 588 switch (MI->getOpcode()) { |
584 default: return 0; | 589 default: return 0; |
585 // These labels may indicate an indirect entry point that is | 590 // These labels may indicate an indirect entry point that is |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 // TODO: implement | 627 // TODO: implement |
623 } | 628 } |
624 | 629 |
625 // Force static initialization. | 630 // Force static initialization. |
626 extern "C" void LLVMInitializeMipsAsmPrinter() { | 631 extern "C" void LLVMInitializeMipsAsmPrinter() { |
627 RegisterAsmPrinter<MipsAsmPrinter> X(TheMipsTarget); | 632 RegisterAsmPrinter<MipsAsmPrinter> X(TheMipsTarget); |
628 RegisterAsmPrinter<MipsAsmPrinter> Y(TheMipselTarget); | 633 RegisterAsmPrinter<MipsAsmPrinter> Y(TheMipselTarget); |
629 RegisterAsmPrinter<MipsAsmPrinter> A(TheMips64Target); | 634 RegisterAsmPrinter<MipsAsmPrinter> A(TheMips64Target); |
630 RegisterAsmPrinter<MipsAsmPrinter> B(TheMips64elTarget); | 635 RegisterAsmPrinter<MipsAsmPrinter> B(TheMips64elTarget); |
631 } | 636 } |
OLD | NEW |