[llvm] [SandboxIR] Clean up tracking code with the help of tryTrack() (PR #102406)

Jorge Gorbe Moya via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 14:13:57 PDT 2024


slackito wrote:

> > hmm, at a first glance this seems a bit too magical, it's not clear that tryTrack is basically make_unique. it's hard to suggest something that isn't so magical though...
> 
> True. We could perhaps rename it to something like `tryAppendNewChange` ?

I would call it `emplace`, to parallel the std containers API. That should make it sufficiently clear that it will create a new object. Or, if you want to be explicit about the fact that tracking might be disabled, `emplaceIfTracking`, but I'm not sure you care about that at the call site (and you already have `isTracking` for the cases where you care).

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


More information about the llvm-commits mailing list