[llvm] [llvm][Support] Enable pass timing in StandardInstrumentations constr… (PR #108983)
    Arthur Eubanks via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Sep 18 18:17:48 PDT 2024
    
    
  
aeubanks 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.
I meant `TimePassesIsEnabled.getNumOccurrences() ? TimePassesIsEnabled : EnableTimePasses`. So only use it if it's explicitly set.
And ideally we'd change clang to also use this rather than setting `llvm::TimePassesIsEnabled`
https://github.com/llvm/llvm-project/pull/108983
    
    
More information about the llvm-commits
mailing list