Repository navigation
v4.0.0
chen 4.0.0 is the analysis core of atom 4. It adds a C and C++ frontend built on the EDG front end, brings every language frontend up to its current syntax, records much more of what each compiler knows as tags on the graph, and makes the data-flow engine faster and more precise. The Code Property Graph schema and the on-disk format are unchanged, so saved atoms keep their format; code that uses chen as a library needs Scala 3.10 and the changes listed below.
The release is documented in detail under docs/v4: what is new, frontends, API and migration, cpg2 and overflowdb2.
Highlights
- edg2atom, a second C/C++ frontend. It builds c2cpg's graph shapes from edga 0.2.0, which runs the EDG front end on each translation unit, so overloads, templates, implicit conversions, virtual calls and object lifetimes are resolved by a production compiler front end. It can fall back to CDT for units edga cannot export, and tags every file with the frontend that built it. Its tests run on Linux, macOS and Windows, and on Windows the header paths in its tags are spelled as real paths, as c2cpg spells them.
- c2cpg parses files as the build does. Compilation databases (
--compile-commands), the real compiler's predefined macros, a macro census (--macro-census,--auto-defines), C++20 modules, C23 and C++23 syntax CDT cannot parse, macro invocations as calls with their provenance, and C++ implicit constructor, destructor and operator calls linked to their methods. - Current languages. Python 3.15 (PEP 810 lazy imports, Unicode 17 identifiers), the PHP 8.5 pipe operator and 8.4 property hooks, Lombok without delombok and build-declared source encodings for Java, TypeScript through atom-parsetools 2.x and its native type engine (1.x keeps working), and Ruby constants and calls from outside the project.
- Vendored code.
--external-paths <regex>marks vendored directories external in every source frontend. - Data flow. Flux is now the default reaching-definitions solver in the library too (
useFluxEngine = falseselects the classic one; both produce identical edges). Semantics are added per language, arguments bind to parameters by keyword, unpacking and variadics as each language does, value operators no longer spread taint between operands, and C and C++ globals and struct members get def-use edges across functions. - Security facts. Framework recognizers for thirteen JavaScript frameworks with npm package attribution of sinks, forwarded-header and proxy-trust tags in five languages, Python template sandboxes and AI model loading, Unicode integrity tags for Trojan Source and look-alike identifiers, and a memory-safety overlay for C and C++.
- Reliability. cpg2 and overflowdb2 3.1.2 evict to disk under every garbage collector and fix the races and deadlocks that crashed or hung large atom runs on small heaps.
Upgrading
For atom users nothing changes beyond installing edga for --c-frontend edg. AST caches from 3.4 are rebuilt on the first run.
For library users:
- Compile with Scala 3.10.0 or later; JDK 23 or newer is still required.
key -> valueno longer builds a property under Scala 3.10; usehas(key, value)orkey.of(value). DefaultSemantics()no longer contains the C library flows.OssDataFlowadds them for C and C++ graphs; if you buildSemanticsyourself, useDefaultSemantics.cSemantics()or addDefaultSemantics.flowsForLanguage(language).EngineContextdefaults to the sharedDefaultSemantics.memoised, which must not be mutated.- Graph content changes for existing node kinds: PHP columns are offsets from the line start, c2cpg's
<global>method is named after the unit,alignof,typeidandtypeofhave their own operators, C++ constructors are named with avoidreturn, and jssrc2cpg type names hold one name instead of the checker's display text. The frontends document lists them all.
Dependencies
Scala 3.10.0, sbt 2.0.10, cpg2 and overflowdb2 3.1.2, Eclipse CDT 9.3.200, edga 0.2.0 for the EDG frontend, and atom-parsetools 1.x or 2.x for JavaScript, TypeScript and Ruby.
Thanks
August Johansson made the project fingerprint stream files so a file of 2 GiB or more no longer runs the JVM out of memory (#193), tagged Angular signal inputs as framework inputs (#196), and built the member writes once per run (#230), and helped track down the cause through cdxgen/cdxgen#4613.
Full Changelog: v3.4.0...v4.0.0