Change misleading method name. This isn't saving an insertion point but
returning the saved insertion point.
Details
- Reviewers
mehdi_amini rriddle
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm not +1 on this change. The function is a verb, i.e. it is requesting that the builder "save" the current insertion point inside of an InsertionPoint and return it.
This also matches the same verbiage in other parts of LLVM, IRBuilder::saveIP/llvm::SaveAndRestore/etc.
Hmm... but it's not saving the current insertion point. It's only returning the saved one. It's the InsertionGuard ctor that's saving the insertion point. Am I missing something?
Oh I see - the saveInsertionPoint here is used to refer to the insertion point to use for saving?
Yeah, sorry about the short replies. The way that it is intended to be read is that you are saving the current insertion point of the builder and storing it somewhere else. That is why there is the companion restore method, so that you can restore a previously saved insertion point. The reason why "saved" sounds weird is that the builder isn't saving an insertion point, it just has one.