r222679 - CodeGen: use a range-based for loop

David Blaikie dblaikie at gmail.com
Mon Nov 24 12:47:40 PST 2014


On Mon, Nov 24, 2014 at 12:14 PM, Saleem Abdulrasool <compnerd at compnerd.org>
wrote:

> Author: compnerd
> Date: Mon Nov 24 14:14:26 2014
> New Revision: 222679
>
> URL: http://llvm.org/viewvc/llvm-project?rev=222679&view=rev
> Log:
> CodeGen: use a range-based for loop
>
> Convert a debug assertion into a range-based loop form.  NFC.
>
> Modified:
>     cfe/trunk/lib/CodeGen/CGCall.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=222679&r1=222678&r2=222679&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Mon Nov 24 14:14:26 2014
> @@ -447,9 +447,8 @@ CodeGenTypes::arrangeLLVMFunctionInfo(Ca
>                                        FunctionType::ExtInfo info,
>                                        RequiredArgs required) {
>  #ifndef NDEBUG
> -  for (ArrayRef<CanQualType>::const_iterator
> -         I = argTypes.begin(), E = argTypes.end(); I != E; ++I)
> -    assert(I->isCanonicalAsParam());
> +  for (const auto &AT : argTypes)
> +    assert(AT.isCanonicalAsParam());
>  #endif
>

How about:

  assert(std::all_of(argTypes.begin(), argTypes.end(),
std::mem_fun_ref(&CanQualType::isCanonicalAsParam));

?


>
>    unsigned CC = ClangCallConvToLLVMCallConv(info.getCC());
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141124/88adeee7/attachment.html>


More information about the cfe-commits mailing list