[llvm] [opt] Add --save-stats option (PR #167304)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 11 05:44:25 PST 2025


================
@@ -203,6 +213,17 @@ LLVM_ABI Expected<std::unique_ptr<TargetMachine>> createTargetMachineForTriple(
     StringRef TargetTriple,
     CodeGenOptLevel OptLevel = CodeGenOptLevel::Default);
 
+/// Conditionally enables the collection of LLVM statistics during the tool run,
+/// based on the value of the flag. Must be call before the tool run to actually
+/// collect data.
+LLVM_ABI int MaybeEnableStatistics();
+
+/// Conditionally saves the collected LLVM statistics to the recevied output
----------------
dtcxzyw wrote:

```suggestion
/// Conditionally saves the collected LLVM statistics to the received output
```

https://github.com/llvm/llvm-project/pull/167304


More information about the llvm-commits mailing list