r222721 - CodeGen: further simplify assertion

Saleem Abdulrasool compnerd at compnerd.org
Mon Nov 24 19:49:50 PST 2014


Author: compnerd
Date: Mon Nov 24 21:49:50 2014
New Revision: 222721

URL: http://llvm.org/viewvc/llvm-project?rev=222721&view=rev
Log:
CodeGen: further simplify assertion

Use more of algorithm to simplify the assertion.  Pointed out by David Blakie!

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=222721&r1=222720&r2=222721&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Mon Nov 24 21:49:50 2014
@@ -446,10 +446,8 @@ CodeGenTypes::arrangeLLVMFunctionInfo(Ca
                                       ArrayRef<CanQualType> argTypes,
                                       FunctionType::ExtInfo info,
                                       RequiredArgs required) {
-#ifndef NDEBUG
-  for (const auto &AT : argTypes)
-    assert(AT.isCanonicalAsParam());
-#endif
+  assert(std::all_of(argTypes.begin(), argTypes.end(),
+                     std::mem_fun_ref(&CanQualType::isCanonicalAsParam)));
 
   unsigned CC = ClangCallConvToLLVMCallConv(info.getCC());
 





More information about the cfe-commits mailing list