Skip to content

GCC to CAST Pipeline and Tools

Clayton T. Morrison edited this page Jun 27, 2022 · 2 revisions

Introduction

Notes on various tools and interfaces in the GCC to CAST pipeline (including using the GCC plugin).

All references to gcc and g++ below assume you are using actual GCC, not clang. E.g., if you manually installed GCC 10.1.0 on a mac, it might live under /usr/local/gcc-10.1.0/bin/g++-10.1

Run GCC with the plugin

  • $ g++ -fplugin=<path_to_ast_dump_file> -c -x c++ -O0 <c_program_file_name> -o /dev/null -lm

Dump Gimple

  • $ gcc -fdump-tree-gimple <c_program_file_name>

Visualize Gimple control flow graph

  • scripts/program_analysis/gcc_to_agraph.py <gcc_plugin-generated_json_filename>

Clone this wiki locally