zeyi2 wrote:

I think this patch needs some discussion, because it introduces a new format:

```
[1/5] (1/1) Processing file ...
[2/5] (1/2) Processing file ...
[2/5] (2/2) Processing file ...
[3/5] (1/2) Processing file ...
```

I initially considered (and implemented) a solution that does normal printing 
like `[n/TotalActions]`. But I discarded it and chose this way of printing due 
to two main reasons:

- Complexity: Calculating the exact number of compile actions requires calling 
`getCompileCommands` for every input files. Which is O(N) and may cause startup 
delay for large projects.
- API contract: `getCompileCommands` may be stateful. Pre-scanning the database 
violates the requirement of "this method needs to run right before we invoke 
the tool", and it may trigger unnecessary side effects.

The current patch maintains the O(1) complexity and doesn't violate the API 
usage, while still reflect the correct progress without misleading users.

I understand that this may not be an ideal way of solving this problem. I 
highly value any thoughts or feedback on this implementation or potential 
alternative strategies.

Thanks in advance.


https://github.com/llvm/llvm-project/pull/169640
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to