pcc added a subscriber: cfe-commits. pcc added inline comments.
================ Comment at: lib/CodeGen/CodeGenFunction.cpp:785 + // Ignore unrelated casts from C++ calls to allocate(). Don't match on the + // namespace because not all allocators are in std:: ---------------- The comment should explain why. ================ Comment at: lib/CodeGen/CodeGenFunction.cpp:789 + auto *MD = dyn_cast_or_null<CXXMethodDecl>(D); + if (MD && MD->getName().equals("allocate") && MD->getNumParams() == 2) { + auto *BT = MD->parameters()[0]->getType()->getAs<BuiltinType>(); ---------------- Should this also match the C++17 allocate function which takes a single argument? ================ Comment at: lib/CodeGen/CodeGenFunction.cpp:794 + PT->getPointeeType().isConstQualified() && + (BT->getKind() == BuiltinType::UInt || + BT->getKind() == BuiltinType::ULong)) ---------------- Maybe better to compare against `ASTContext::getSizeType()`, which should return the builtin type that corresponds to `size_t`. https://reviews.llvm.org/D36294 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits