CodeQL library for C/C++
Search

Module PrintIR

Outputs a representation of the IR as a control flow graph.

This file contains the actual implementation of PrintIR.ql. For test cases and very small databases, PrintIR.ql can be run directly to dump the IR for the entire database. For most uses, however, it is better to write a query that imports PrintIR.qll, extends PrintIRConfiguration, and overrides shouldPrintFunction() to select a subset of functions to dump.

Import path

import semmle.code.cpp.ir.implementation.aliased_ssa.PrintIR

Imports

IRConfiguration

Module used to configure the IR generation process.

Predicates

edges

Holds if the output graph contains an edge from pred to succ, and that edge’s property key has the given value.

nodes

Holds if node belongs to the output graph, and its property key has the given value.

parents

Holds if parent is the parent node of child in the output graph.

Classes

PrintIRConfiguration

The query can extend this class to control which functions are printed.