rsmith added a comment.

There's some corresponding code in `lib/CodeGen` that can be deleted too:

     case Builtin::BI__builtin_assume_aligned: {
       const Expr *Ptr = E->getArg(0);
       Value *PtrValue = EmitScalarExpr(Ptr);
  -     if (PtrValue->getType() != VoidPtrTy)
  -       PtrValue = EmitCastToVoidPtr(PtrValue);
       Value *OffsetValue =
         (E->getNumArgs() > 2) ? EmitScalarExpr(E->getArg(2)) : nullptr;



================
Comment at: clang/lib/Sema/SemaChecking.cpp:7979-7986
   {
     ExprResult FirstArgResult =
         DefaultFunctionArrayLvalueConversion(FirstArg);
-    if (FirstArgResult.isInvalid())
+    if (checkBuiltinArgument(*this, TheCall, 0))
       return true;
+    /// In-place updation of FirstArg by checkBuiltinArgument is ignored.
     TheCall->setArg(0, FirstArgResult.get());
----------------
This still seems to be more complex than necessary. If we can't just do this, 
we should have a comment explaining why. (Eg, does CodeGen really want the 
final conversion from `T*` to `const void*` to not be in the AST?)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149514/new/

https://reviews.llvm.org/D149514

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to