Generating call tree for LLVM pass


Is there any good/recommended/known(?) way to generate call tree for single LLVM pass? By pass I mean any type of pass present inside LLVM. The goal of this is to have birds-eye-view of how functions are connected inside some of the more complex passes. I like how it is done in LLVM’s doxygen documentation for example for Value or Instruction, where it is clearly laid out what is originating from what. It would be nice to see something similar for internals of the passes.

I know that something like this can be obtained for single c++ file using clang++ but that wouldn’t work with linking across files as I understand. Doing some research online I’ve found those SO posts:

  1. How to generate a single LLVM IR from multiple sources

  2. Specifying multiple files when compiling from C++ to LLVM IR using clang

But none of them have decent answer and mostly boils down to suggestion - compile each file individually and then “stich” them somehow.

Does anyone had experience with such task? Any suggestions?