Skip to content

Assignments 05 mc asm

Mugundan edited this page Nov 27, 2026 · 1 revision

Stage 4: MC Layer for Assembly Output

Relevant source files

The following files were used as context for generating this wiki page:

Register the MC objects every tool needs: instruction, register and subtarget info, `MCAsmInfo`, and the instruction printer.

Purpose and Scope

MCTargetDesc/ with ToyMCTargetDesc.cpp, ToyMCAsmInfo, ToyInstPrinter and LLVMInitializeToyTargetMC.

Read First

Tasks

  1. ToyMCAsmInfo : MCAsmInfoELF with comment string #, 4-byte alignment, DWARF CFI.
  2. ToyInstPrinter using generated printInstruction/getRegisterName; write printOperand for registers and immediates, and a memory operand printer imm(reg).
  3. Register asm info, instr info, register info, subtarget info and printer.

Tests

Everything links; llvm-mc -triple=toy-unknown-elf --version runs (no parser yet).

Done When

  • LLVMToyDesc links without CodeGen
  • No missing-factory crash when tools start

Next: stage 5. All Toy code and expected output on this page are illustrative, not LLVM source and not tool output; your exact output may differ.

Start here

Computer Organization & Architecture

Hexagon ISA

Operating Systems

C++ for LLVM Development

LLVM IR

SelectionDAG

Backend Assignments

Target Bring-up

Calling Conventions

Frame Lowering

MC Layer

Register Allocation

Scheduling

Clone this wiki locally