[llvm] [llvm][Support] Enable pass timing in StandardInstrumentations constr… (PR #108983)

Tarun Prabhu via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 18:12:42 PDT 2024


tarunprabhu wrote:

Thanks for taking a look, Arthur.

> I'm not really a fan of the `std::optional<bool>` though. what about just making the param a bool that defaults to `false`, and the `cl::opt` flags override it if they are explicitly specified?

If I understand you correctly, you are suggesting 

```
 TimePasses(TimePassesIsEnabled ? TimePassesIsEnabled : EnableTimePasses,
                       TimePassesPerRun ? TimePassesPerRun : EnablePerRunTiming)
```

I think explicitly specifying the option will set `TimePassesIsEnabled` to `true`. Of course, that variable is exposed, so it can also be set to true without use of a command-line option which is what `clang` currently does. 

> also, we really should make the `StandardInstrumentations` constructor take a `StandardInstrumentationsOptions` as opposed to a bunch of separate params, but that can be a followup

That is a good idea. I am happy to take a stab at it later. 

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


More information about the llvm-commits mailing list