OLD | NEW |
1 //===-- ARMAsmPrinter.cpp - Print machine code to an ARM .s file ----------===// | 1 //===-- ARMAsmPrinter.cpp - Print machine code to an ARM .s file ----------===// |
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 22 matching lines...) Expand all Loading... |
33 #include "llvm/IR/Constants.h" | 33 #include "llvm/IR/Constants.h" |
34 #include "llvm/IR/DataLayout.h" | 34 #include "llvm/IR/DataLayout.h" |
35 #include "llvm/IR/Module.h" | 35 #include "llvm/IR/Module.h" |
36 #include "llvm/IR/Type.h" | 36 #include "llvm/IR/Type.h" |
37 #include "llvm/MC/MCAsmInfo.h" | 37 #include "llvm/MC/MCAsmInfo.h" |
38 #include "llvm/MC/MCAssembler.h" | 38 #include "llvm/MC/MCAssembler.h" |
39 #include "llvm/MC/MCContext.h" | 39 #include "llvm/MC/MCContext.h" |
40 #include "llvm/MC/MCELFStreamer.h" | 40 #include "llvm/MC/MCELFStreamer.h" |
41 #include "llvm/MC/MCInst.h" | 41 #include "llvm/MC/MCInst.h" |
42 #include "llvm/MC/MCInstBuilder.h" | 42 #include "llvm/MC/MCInstBuilder.h" |
| 43 #include "llvm/MC/MCNaCl.h" |
43 #include "llvm/MC/MCObjectStreamer.h" | 44 #include "llvm/MC/MCObjectStreamer.h" |
44 #include "llvm/MC/MCSectionMachO.h" | 45 #include "llvm/MC/MCSectionMachO.h" |
45 #include "llvm/MC/MCStreamer.h" | 46 #include "llvm/MC/MCStreamer.h" |
46 #include "llvm/MC/MCSymbol.h" | 47 #include "llvm/MC/MCSymbol.h" |
47 #include "llvm/Support/CommandLine.h" | 48 #include "llvm/Support/CommandLine.h" |
48 #include "llvm/Support/Debug.h" | 49 #include "llvm/Support/Debug.h" |
49 #include "llvm/Support/ELF.h" | 50 #include "llvm/Support/ELF.h" |
50 #include "llvm/Support/ErrorHandling.h" | 51 #include "llvm/Support/ErrorHandling.h" |
51 #include "llvm/Support/TargetRegistry.h" | 52 #include "llvm/Support/TargetRegistry.h" |
52 #include "llvm/Support/raw_ostream.h" | 53 #include "llvm/Support/raw_ostream.h" |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 } | 727 } |
727 | 728 |
728 // Use unified assembler syntax. | 729 // Use unified assembler syntax. |
729 OutStreamer.EmitAssemblerFlag(MCAF_SyntaxUnified); | 730 OutStreamer.EmitAssemblerFlag(MCAF_SyntaxUnified); |
730 | 731 |
731 // Emit ARM Build Attributes | 732 // Emit ARM Build Attributes |
732 if (Subtarget->isTargetELF()) | 733 if (Subtarget->isTargetELF()) |
733 emitAttributes(); | 734 emitAttributes(); |
734 | 735 |
735 // @LOCALMOD-BEGIN | 736 // @LOCALMOD-BEGIN |
736 if (Subtarget->isTargetNaCl() && OutStreamer.hasRawTextSupport()) { | 737 if (Subtarget->isTargetNaCl()) { |
737 std::string str; | 738 if (OutStreamer.hasRawTextSupport()) { |
738 raw_string_ostream OS(str); | 739 std::string str; |
739 EmitSFIHeaders(OS); | 740 raw_string_ostream OS(str); |
740 OutStreamer.EmitRawText(StringRef(OS.str())); | 741 EmitSFIHeaders(OS); |
| 742 OutStreamer.EmitRawText(StringRef(OS.str())); |
| 743 } |
| 744 initializeNaClMCStreamer(OutStreamer, OutContext, |
| 745 Subtarget->getTargetTriple()); |
741 } | 746 } |
742 // @LOCALMOD-END | 747 // @LOCALMOD-END |
743 } | 748 } |
744 | 749 |
745 void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) { | 750 void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) { |
746 if (Subtarget->isTargetDarwin()) { | 751 if (Subtarget->isTargetDarwin()) { |
747 // All darwin targets use mach-o. | 752 // All darwin targets use mach-o. |
748 const TargetLoweringObjectFileMachO &TLOFMacho = | 753 const TargetLoweringObjectFileMachO &TLOFMacho = |
749 static_cast<const TargetLoweringObjectFileMachO &>(getObjFileLowering()); | 754 static_cast<const TargetLoweringObjectFileMachO &>(getObjFileLowering()); |
750 MachineModuleInfoMachO &MMIMacho = | 755 MachineModuleInfoMachO &MMIMacho = |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 | 2125 |
2121 //===----------------------------------------------------------------------===// | 2126 //===----------------------------------------------------------------------===// |
2122 // Target Registry Stuff | 2127 // Target Registry Stuff |
2123 //===----------------------------------------------------------------------===// | 2128 //===----------------------------------------------------------------------===// |
2124 | 2129 |
2125 // Force static initialization. | 2130 // Force static initialization. |
2126 extern "C" void LLVMInitializeARMAsmPrinter() { | 2131 extern "C" void LLVMInitializeARMAsmPrinter() { |
2127 RegisterAsmPrinter<ARMAsmPrinter> X(TheARMTarget); | 2132 RegisterAsmPrinter<ARMAsmPrinter> X(TheARMTarget); |
2128 RegisterAsmPrinter<ARMAsmPrinter> Y(TheThumbTarget); | 2133 RegisterAsmPrinter<ARMAsmPrinter> Y(TheThumbTarget); |
2129 } | 2134 } |
OLD | NEW |