[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Thu May 22 07:02:56 PDT 2025


================
@@ -542,7 +542,8 @@ bool SemaOpenCL::checkBuiltinToAddr(unsigned BuiltinID, CallExpr *Call) {
   auto RT = Call->getArg(0)->getType();
   if (!RT->isPointerType() ||
       RT->getPointeeType().getAddressSpace() == LangAS::opencl_constant) {
-    Diag(Call->getBeginLoc(), diag::err_opencl_builtin_to_addr_invalid_arg)
+    Diag(Call->getArg(0)->getBeginLoc(),
----------------
zyn0217 wrote:

Why Call->getBeginLoc() no longer works?

https://github.com/llvm/llvm-project/pull/141058


More information about the cfe-commits mailing list