[PATCH] D142736: Add QualType::getNullability for _Optional

Christopher Bazley via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 27 08:48:49 PST 2023


chrisbazley created this revision.
Herald added subscribers: kadircet, arphaman.
Herald added a project: All.
chrisbazley requested review of this revision.
Herald added projects: clang, clang-tools-extra.
Herald added a subscriber: cfe-commits.

The purpose of this change is to ensure that a
qualified declaration such as '_Optional int *' is
treated as equivalent to the annotated declaration
'int *_Nullable' in all situations where type
qualifiers are available.

The new method falls back to Type::getNullability() if
called for a QualType which is not a pointer to an
_Optional-qualified type.

Updated all of the callers which previously invoked
Type::getNullability() via QualType::operator->() so
that they call the new method directly on the QualType
instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142736

Files:
  clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/Type.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/Type.cpp
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CGDecl.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/Sema/Sema.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaDeclObjC.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaExprObjC.cpp
  clang/lib/Sema/SemaLambda.cpp
  clang/lib/Sema/SemaObjCProperty.cpp
  clang/lib/Sema/SemaType.cpp
  clang/tools/libclang/CXType.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142736.492783.patch
Type: text/x-patch
Size: 18554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230127/d10cb66f/attachment-0001.bin>


More information about the cfe-commits mailing list