[llvm] r250193 - ExecutionEngine: Remove implicit ilist iterator conversions, NFC

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 13 14:12:37 PDT 2015


On Tue, Oct 13, 2015 at 11:11 AM, Duncan P. N. Exon Smith via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: dexonsmith
> Date: Tue Oct 13 13:11:02 2015
> New Revision: 250193
>
> URL: http://llvm.org/viewvc/llvm-project?rev=250193&view=rev
> Log:
> ExecutionEngine: Remove implicit ilist iterator conversions, NFC
>

BTW, I realize this is probably out of scope for your refactoring, but an
alternative approach would be to make a lot of these functions take
references instead of pointers so there's not adding lots of address-of
operators all over the place. (I did this a lot with unique_ptr migrations
- by making the underlying APIs take references intsead of pointers first,
the actual unique_ptrification doesn't change the use at all (what was a
pointer deref becomes a smart pointer deref - the same syntax) - not quite
as clean in your case, there's still going to be a range-for-ification
and/or a deref to be added, but otherwise might be nice)


>
> Modified:
>     llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
>
> Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=250193&r1=250192&r2=250193&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Tue Oct 13 13:11:02
> 2015
> @@ -237,11 +237,10 @@ void ExecutionEngine::clearAllGlobalMapp
>  void ExecutionEngine::clearGlobalMappingsFromModule(Module *M) {
>    MutexGuard locked(lock);
>
> -  for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
> -    EEState.RemoveMapping(getMangledName(FI));
> -  for (Module::global_iterator GI = M->global_begin(), GE =
> M->global_end();
> -       GI != GE; ++GI)
> -    EEState.RemoveMapping(getMangledName(GI));
> +  for (Function &FI : *M)
> +    EEState.RemoveMapping(getMangledName(&FI));
> +  for (GlobalVariable &GI : M->globals())
> +    EEState.RemoveMapping(getMangledName(&GI));
>  }
>
>  uint64_t ExecutionEngine::updateGlobalMapping(const GlobalValue *GV,
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151013/1fe961c8/attachment.html>


More information about the llvm-commits mailing list