003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
lib
/
Target
/
MSP430
/
MCTargetDesc
/
📁
..
📄
MSP430AsmBackend.cpp
(5.94 KB)
📄
MSP430ELFObjectWriter.cpp
(2.29 KB)
📄
MSP430ELFStreamer.cpp
(2.5 KB)
📄
MSP430FixupKinds.h
(1.43 KB)
📄
MSP430InstPrinter.cpp
(4.16 KB)
📄
MSP430InstPrinter.h
(2.08 KB)
📄
MSP430MCAsmInfo.cpp
(944 B)
📄
MSP430MCAsmInfo.h
(908 B)
📄
MSP430MCCodeEmitter.cpp
(7.15 KB)
📄
MSP430MCTargetDesc.cpp
(2.54 KB)
📄
MSP430MCTargetDesc.h
(1.98 KB)
Editing: MSP430ELFStreamer.cpp
//===-- MSP430ELFStreamer.cpp - MSP430 ELF Target Streamer Methods --------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file provides MSP430 specific target streamer methods. // //===----------------------------------------------------------------------===// #include "MSP430MCTargetDesc.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCELFStreamer.h" #include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSubtargetInfo.h" using namespace llvm; namespace llvm { class MSP430TargetELFStreamer : public MCTargetStreamer { public: MCELFStreamer &getStreamer(); MSP430TargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI); }; // This part is for ELF object output. MSP430TargetELFStreamer::MSP430TargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI) : MCTargetStreamer(S) { MCAssembler &MCA = getStreamer().getAssembler(); unsigned EFlags = MCA.getELFHeaderEFlags(); MCA.setELFHeaderEFlags(EFlags); // Emit build attributes section according to // MSP430 EABI (slaa534.pdf, part 13). MCSection *AttributeSection = getStreamer().getContext().getELFSection( ".MSP430.attributes", ELF::SHT_MSP430_ATTRIBUTES, 0); Streamer.SwitchSection(AttributeSection); // Format version. Streamer.emitInt8(0x41); // Subsection length. Streamer.emitInt32(22); // Vendor name string, zero-terminated. Streamer.emitBytes("mspabi"); Streamer.emitInt8(0); // Attribute vector scope tag. 1 stands for the entire file. Streamer.emitInt8(1); // Attribute vector length. Streamer.emitInt32(11); // OFBA_MSPABI_Tag_ISA(4) = 1, MSP430 Streamer.emitInt8(4); Streamer.emitInt8(1); // OFBA_MSPABI_Tag_Code_Model(6) = 1, Small Streamer.emitInt8(6); Streamer.emitInt8(1); // OFBA_MSPABI_Tag_Data_Model(8) = 1, Small Streamer.emitInt8(8); Streamer.emitInt8(1); } MCELFStreamer &MSP430TargetELFStreamer::getStreamer() { return static_cast<MCELFStreamer &>(Streamer); } MCTargetStreamer * createMSP430ObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) { const Triple &TT = STI.getTargetTriple(); if (TT.isOSBinFormatELF()) return new MSP430TargetELFStreamer(S, STI); return nullptr; } } // namespace llvm
Upload File
Create Folder