Currently, member functions like File::defined() return an iterator for const atoms. But we don't actually treat atoms as consts -- we updates atoms in many places including the core resolver. We have too many const_casts in our code. It just doesn't make sense. I'm making a change to make atoms non-const. Please hit reply if you have any concerns. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150407/a1de5102/attachment.html>
On Tue, Apr 7, 2015 at 3:58 PM, Rui Ueyama <ruiu at google.com> wrote:> Currently, member functions like File::defined() return an iterator for > const atoms. But we don't actually treat atoms as consts -- we updates atoms > in many places including the core resolver. > > We have too many const_casts in our code. It just doesn't make sense. > > I'm making a change to make atoms non-const. Please hit reply if you have > any concerns. >Not concerns, but still I want to add my $0.02 There was already some discussion about this, see the mail derived from http://reviews.llvm.org/D8372 I'm all in favour of the change because it will allow me to rewrite that patch in such a cleaner and better way (and enables future optimisations). -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare
On 4/7/2015 5:58 PM, Rui Ueyama wrote:> Currently, member functions like File::defined() return an iterator for > const atoms. But we don't actually treat atoms as consts -- we updates > atoms in many places including the core resolver. > > We have too many const_casts in our code. It just doesn't make sense. > > I'm making a change to make atoms non-const. Please hit reply if you have > any concerns. >Returning a non const iterator would be a nice change. Shankar Easwaran -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation
Looks like there's no push-back, so I'll start working on this. Before that, it looks like I have to simplify atom_collection and its iterators, so I'll start off with that. Thanks! On Wed, Apr 8, 2015 at 10:59 AM, Shankar Easwaran <shankare at codeaurora.org> wrote:> On 4/7/2015 5:58 PM, Rui Ueyama wrote: > >> Currently, member functions like File::defined() return an iterator for >> const atoms. But we don't actually treat atoms as consts -- we updates >> atoms in many places including the core resolver. >> >> We have too many const_casts in our code. It just doesn't make sense. >> >> I'm making a change to make atoms non-const. Please hit reply if you have >> any concerns. >> >> Returning a non const iterator would be a nice change. > > Shankar Easwaran > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by the Linux Foundation > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150408/93e7b1c7/attachment.html>
Reasonably Related Threads
- [LLVMdev] [lld] process undefined atoms from shared library only once
- [LLVMdev] Chaining Atoms together
- [LLVMdev] Chaining Atoms together
- [LLVMdev] [lld] process undefined atoms from shared library only once
- [LLVMdev] [lld] adding deadStrip() to undefined Atoms