r297975 - Use arg_begin() instead of getArgumentList().begin(), the argument list is an implementation detail

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 20 08:54:59 PDT 2017


On Thu, Mar 16, 2017 at 12:07 PM Reid Kleckner via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: rnk
> Date: Thu Mar 16 13:55:46 2017
> New Revision: 297975
>
> URL: http://llvm.org/viewvc/llvm-project?rev=297975&view=rev
> Log:
> Use arg_begin() instead of getArgumentList().begin(), the argument list is
> an implementation detail
>

Seems like a somewhat strange justification, given that getArgumentList
looks like a public member and probably used pervasively before LLVM moved
towards more iterator-centric interfaces, etc.

What do you mean by 'an implementation detail' in this context/what
motivated this change? (curious what I'm missing)

- Dave


>
> Modified:
>     cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=297975&r1=297974&r2=297975&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Thu Mar 16 13:55:46 2017
> @@ -3780,9 +3780,7 @@ CGOpenMPRuntime::emitTaskInit(CodeGenFun
>    // Emit initial values for private copies (if any).
>    llvm::Value *TaskPrivatesMap = nullptr;
>    auto *TaskPrivatesMapTy =
> -
> std::next(cast<llvm::Function>(TaskFunction)->getArgumentList().begin(),
> -                3)
> -          ->getType();
> +      std::next(cast<llvm::Function>(TaskFunction)->arg_begin(),
> 3)->getType();
>    if (!Privates.empty()) {
>      auto FI = std::next(KmpTaskTWithPrivatesQTyRD->field_begin());
>      TaskPrivatesMap = emitTaskPrivateMappingFunction(
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170320/1dd9b6c2/attachment-0001.html>


More information about the cfe-commits mailing list