Skip to content

sunxfancy/vscode-llvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2d62187 · May 30, 2024

History

52 Commits
Jan 8, 2024
Dec 4, 2023
Jan 11, 2024
Dec 3, 2023
Dec 4, 2023
May 30, 2024
Sep 7, 2022
Jan 27, 2024
Sep 7, 2022
Sep 7, 2022
Sep 7, 2022
Dec 4, 2023
Dec 3, 2023
Dec 3, 2023
Dec 17, 2023
Dec 4, 2023
May 30, 2024
Sep 7, 2022
Sep 7, 2022
Sep 7, 2022
Dec 4, 2023

Repository files navigation

VSCode LLVM Compiler Explorer

Download from VSCode marketplace.

This is a tool for compiler developers of LLVM. This vscode extension can support exploring LLVM IR and machine IR after each pass.

Features

  1. Run a clang command and explore preprocessing phase, clang AST building phase, each phase of LLVM passes, and final generated assembly code.
  2. Compare difference between IRs before and after running a pass.
  3. Support custom clang or modified version.

How to use

  1. Click 'New config' for creating a new configuration
  2. Type your command to compile the file

  1. (Optional) If you want to focus on one function. You can type the function name in the 'filter function' field. Please note, this function name should be mangle name if it's C++. Then, click the command name to run the command.
  2. Now, you can explore the IRs after each pass.

Compare Mode

To debug a pass, you may want to compare a clang command with and without the pass. Or you want to debug a different version of clang with the stable version. This extension can help you to compare the difference between two IRs after each pass.

Source2Asm Mapping View

Inspired by Compiler Explorer, this extension can highlight the mapping between source code and the assembly code.

Run Print Pass to View CallGraph/CFG/DOMTree

There is a list of utility passes available in this plugin. You can run these passes to view the CallGraph, CFG, and DOMTree of an IR file.

When you open an IR file, you can click the 'Print Call Graph' button to generate a callgraph.dot file. Then, you can use the Graphviz plugin to view the callgraph.

Note: You need to have 'opt' tool in your PATH (or specify the path in settings) and installed Graphviz preview plugin.

Syntax Highlighting

This plugin provides syntax highlighting for Clang AST and assembly language. You may need to install additional LLVM syntax highlighting plugins, there are some options: