[PATCH] D74693: [IRBuilder] Delete copy constructor
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 16 09:33:18 PST 2020
nikic created this revision.
nikic added reviewers: nhaehnle, Meinersbur, spatel, lebedev.ri.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
Motivated by D73835 <https://reviews.llvm.org/D73835>, where IRBuilder becomes no longer trivially copyable, but I think this also makes sense independently. Currently, it seems that the IRBuilder copy constructor is usually used by accident, not by intention. In rG7c362b25d7a9 <https://reviews.llvm.org/rG7c362b25d7a9093d7d38171f2684876b63bb5a57> I've fixed a number of cases where functions accepted `IRBuilder` rather than `IRBuilder &`, thus performing an unnecessary copy. In rG5f7b92b1b4d6 <https://reviews.llvm.org/rG5f7b92b1b4d6941051380a9fd5b2b85718cce1c2> I've fixed cases where an IRBuilder was copied, while an InsertPointGuard should have been used instead.
The only non-trivial use of the copy constructor is the `getIRBForDbgInsertion()` helper, which is replaced by a `IRBuilderForDbg` class in this patch.
Does this make sense?
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74693
Files:
llvm/include/llvm/IR/IRBuilder.h
llvm/lib/IR/DIBuilder.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74693.244887.patch
Type: text/x-patch
Size: 5744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200216/a35add25/attachment.bin>
More information about the llvm-commits
mailing list