Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Ready-to-adapt workflow examples:
--compdb=<path> alias for --compile-commands
--compdb-fast drops heavy build flags for faster analysis
--include-compdb-deps includes `_deps` entries when inputs are auto-discovered from compile_commands.json
--jobs=<N|auto> parallel jobs for multi-file loading/analysis and cross-TU resource summary build (default: 1)
--jobs=<N|auto> parallel jobs for the cross-TU summaries of multi-file runs (default: auto)
--escape-model=<path> loads external noescape rules for stack pointer escape analysis (`noescape_arg`)
--buffer-model=<path> loads external buffer write rules for copy/string overflow checks (`bounded_write`/`unbounded_write`)
--resource-model=<path> loads external acquire/release rules for generic resource lifetime checks
Expand Down Expand Up @@ -295,7 +295,7 @@ To generate `compile_commands.json` with CMake, configure with

If analysis feels slow, `--compdb-fast` disables heavy flags (optimizations,
sanitizers, profiling) while keeping include paths and macros.
For multi-file runs, `--jobs=<N|auto>` parallelizes input loading; with cross-TU enabled it also parallelizes summary construction.
For multi-file runs, `--jobs=<N|auto>` parallelizes the construction of cross-TU summaries; the inputs are loaded one at a time.
`--compile-ir-cache-dir=<path>` reuses compiled LLVM IR for unchanged translation units
based on source/dependency stamps, which reduces repeated C/C++ frontend cost across runs.
IR that another compiler produced (another coretrace-compiler revision or LLVM version) is compiled again.
Expand Down Expand Up @@ -574,7 +574,7 @@ Cross-TU summary behavior:
- `--no-resource-cross-tu` forces local-only (single-file) resource reasoning.
- `--resource-summary-cache-dir=<path>` controls where per-module summary cache files are stored.
- `--resource-summary-cache-memory-only` disables filesystem cache writes and uses an in-process cache only.
- `--jobs=<N>` parallelizes module loading/compilation and per-module summary extraction during each fixpoint iteration.
- `--jobs=<N>` parallelizes per-module summary extraction during each fixpoint iteration; modules are loaded one at a time.
- The CLI prints an explicit status line to `stderr` to indicate whether resource inter-procedural
analysis is enabled or unavailable/disabled (with reason).
- If a local release depends on an unmodeled/external callee and no summary is available, the tool
Expand Down
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ static void printHelp()
<< " --compdb-fast Speed up compdb builds (drops heavy flags)\n"
<< " --include-compdb-deps Include _deps entries when auto-discovering files from "
"compile_commands.json\n"
<< " --jobs=<N|auto> Parallel jobs for multi-file loading/analysis and cross-TU "
"summary build (default: 1)\n"
<< " --jobs=<N|auto> Parallel jobs for the cross-TU summaries of multi-file runs "
"(default: auto)\n"
<< " If no input files are provided, supported files are loaded\n"
<< " from compile_commands.json automatically.\n"
<< " --timing Print compilation/analysis timing to stderr\n"
Expand Down
17 changes: 6 additions & 11 deletions src/app/AnalyzerApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,17 +957,12 @@ static AppStatus analyzeWithSharedModuleLoading(const std::vector<std::string>&
loadSucceeded[index] = 1;
};

const unsigned loadJobs = resolveConfiguredJobs(cfg);
if (loadJobs <= 1 || inputFilenames.size() <= 1)
{
for (std::size_t index = 0; index < inputFilenames.size(); ++index)
loadSingleModule(index);
}
else
{
runParallelWork(inputFilenames.size(), loadJobs,
[&](std::size_t index) { loadSingleModule(index); });
}
// One input after the other, on this thread, whatever --jobs. The compilations are serialized
// (InputPipeline.cpp): a loading worker would only parse its bitcode in parallel, while glibc
// would give it an arena of its own and keep there the memory its compilation freed, about one
// compilation per worker for the rest of the run. The cross-TU summaries below still use --jobs.
for (std::size_t index = 0; index < inputFilenames.size(); ++index)
loadSingleModule(index);

std::vector<LoadedInputModule> orderedLoadedModules;
orderedLoadedModules.reserve(inputFilenames.size());
Expand Down
Loading