[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 12 10:18:29 PST 2024


================
@@ -7519,6 +7519,26 @@ static bool HandleWebAssemblyFuncrefAttr(TypeProcessingState &State,
   return false;
 }
 
+/// Rebuild an attributed type without the nullability attribute on it.
+static QualType rebuildAttributedTypeWithoutNullability(ASTContext &Ctx,
+                                                        QualType Type) {
+  auto Attributed = dyn_cast<AttributedType>(Type.getTypePtr());
+  if (!Attributed)
+    return Type;
+
+  // Skip the nullability attribute; we're done.
+  if (Attributed->getImmediateNullability()) {
+    return Attributed->getModifiedType();
+  }
----------------
compnerd wrote:

Unnecessary braces

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


More information about the cfe-commits mailing list