[PATCH] D96196: [Sema][NFC] Create Sema::BuildImplicitCast

FĂ©lix Cloutier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 5 20:19:33 PST 2021


fcloutier created this revision.
Herald added a subscriber: jfb.
Herald added a reviewer: aaron.ballman.
fcloutier requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

This change creates Sema::BuildImplicitCast, which the rest of Sema now uses to
create implicit casts. The main change in terms of interface is that now,
technically, creating an implicit cast could fail. However, the current
implementation of BuildImplicitCast never does because it simply calls
ImplicitCastExpr::Create.

Nevertheless, Sema users of ImplicitCastExpr::Create, and their downstream users
in several cases, were updated to allow failing, except in some cases (such as
in OpenMP) where existing code already didn't bother to check implicit casts
failing.

rdar://74050758


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96196

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/Sema.cpp
  clang/lib/Sema/SemaCast.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/lib/Sema/SemaExprObjC.cpp
  clang/lib/Sema/SemaInit.cpp
  clang/lib/Sema/SemaLambda.cpp
  clang/lib/Sema/SemaObjCProperty.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/SemaStmt.cpp
  clang/lib/Sema/SemaTemplate.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96196.321916.patch
Type: text/x-patch
Size: 47546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210206/60c279dc/attachment-0001.bin>


More information about the cfe-commits mailing list