[all-commits] [llvm/llvm-project] 7d80b9: Add a utility for converting between different typ...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Mon Sep 12 15:05:03 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d80b94ca3ab4563c964ebbf3662c0d3033dc91a
      https://github.com/llvm/llvm-project/commit/7d80b94ca3ab4563c964ebbf3662c0d3033dc91a
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2022-09-12 (Mon, 12 Sep 2022)

  Changed paths:
    A llvm/docs/CommandGuide/LLVMRemarkUtil.rst
    M llvm/docs/CommandGuide/index.rst
    M llvm/test/CMakeLists.txt
    M llvm/test/lit.cfg.py
    A llvm/test/tools/llvm-remarkutil/Inputs/broken-remark
    A llvm/test/tools/llvm-remarkutil/Inputs/broken-remark.bitstream
    A llvm/test/tools/llvm-remarkutil/Inputs/empty-file
    A llvm/test/tools/llvm-remarkutil/Inputs/two-remarks.bitstream
    A llvm/test/tools/llvm-remarkutil/Inputs/two-remarks.yaml
    A llvm/test/tools/llvm-remarkutil/broken-bitstream-remark.test
    A llvm/test/tools/llvm-remarkutil/broken-yaml-remark.test
    A llvm/test/tools/llvm-remarkutil/convert.test
    A llvm/test/tools/llvm-remarkutil/empty-file.test
    A llvm/test/tools/llvm-remarkutil/file-does-not-exist.test
    A llvm/test/tools/llvm-remarkutil/missing-subcommand.test
    A llvm/tools/llvm-remarkutil/CMakeLists.txt
    A llvm/tools/llvm-remarkutil/RemarkUtil.cpp

  Log Message:
  -----------
  Add a utility for converting between different types of remarks

This adds llvm-remarkutil. This is intended to be a general tool for doing stuff
with/to remark files.

This patch gives it the following powers:

* `bitstream2yaml` - To convert bitstream remarks to YAML
* `yaml2bitstream` - To convert YAML remarks to bitstream remarks

These are both implemented as subcommands, like

`llvm-remarkutil bitstream2yaml <input_file> -o -`

I ran into an issue where I had some bitstream remarks coming from CI, and I
wanted to be able to do stuff with them (e.g. visualize them). But then I
noticed we didn't have any tooling for doing that, so I decided to write this
thing.

Being able to output YAML as a start seemed like a good idea, since it
would allow people to reuse any tooling they may have written based around YAML
remarks.

Hopefully it can grow into a more featureful remark utility. :)

Currently there are is an outstanding performance issue (see the TODO) with
the bitstream2yaml case. I decided that I'd keep the tool small to start with
and have the yaml2bitstream and bitstream2yaml cases be symmetric.

Also I moved the remarks documentation to its own header because it seems
a little out of place with "basic commands" and "developer tools"; it's
really kind of its own thing.

Differential Revision: https://reviews.llvm.org/D133646




More information about the All-commits mailing list