Software Engineering
ATLAS: Open-Source Tool Generates Unified Code Graphs for C and C++ Without Full Compilation
New command-line utility merges abstract syntax, control flow, and data flow representations into a single graph format for source code analysis.
Machine-learning models in software engineering increasingly rely on multi-view code graphs that integrate abstract syntax trees, control flow graphs, and data flow graphs into a cohesive representation. However, building these aligned views for C and C++ traditionally required a complete compilation pipeline—until now.
What ATLAS Does#
Researchers have introduced ATLAS, an open-source command-line tool designed to extract and merge multiple code representations from C and C++ source files without requiring a full build or compilation database. The tool accepts one or more source files as input and can generate an abstract syntax tree (AST), source-level inter-procedural control flow graph (CFG), reaching-definition data flow graph (DFG), or any combination thereof. Output formats include JSON, DOT (graph notation), and PNG (raster images).
Handling Incomplete and Partial Code#
A key advantage of ATLAS is its ability to work directly on raw source code, including incomplete projects with missing headers or files that fail to compile. This flexibility makes it practical for analyzing real-world codebases where perfect build conditions are rare. The tool employs configurable flags to collapse variables, filter node categories, and adjust graph size to suit downstream tasks.
Accuracy and Real-World Performance#
Testing on the TheAlgorithms corpora demonstrated strong performance: ATLAS correctly generated control flow graphs for 96.80% of C files and 91.67% of C++ files, even for code that does not compile. The unified node namespace across all three views enables consumers to isolate any single representation by selectively filtering edges.
Current Applications#
ATLAS already powers the CFG front-end for an LLM-based unit-test generation framework targeting C programs, demonstrating its utility for machine-learning-assisted code analysis and tool development. The project ships as a Docker image with a screencast walkthrough to facilitate adoption.