Loading the code workspace…
Implement a pretty-printer and parser for your three-address code IR that support round-trip conversion.
Format instructions:
result = arg1 op arg2result = arg1label_name:goto labelif condition goto labelAdd structure:
Output:
Read instructions:
Error handling:
Validation:
LLVM's textual IR (.ll files) is round-trippable by design, and that decision made the entire ecosystem debuggable: every optimization bug report is a before/after IR dump. FileCheck-based tests — thousands of them in LLVM's repo — only work because the printer and parser agree, which is the invariant you are building.
Sample case for Run. Submit grades this sample plus all hidden tests.