[PATCH] D131872: [Intrinsics] Add initial support for NonNull attribute

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 02:34:40 PDT 2022


ChuanqiXu added inline comments.


================
Comment at: llvm/include/llvm/IR/Intrinsics.td:1415
 def int_threadlocal_address : DefaultAttrsIntrinsic<[llvm_anyptr_ty], [LLVMMatchType<0>],
-                           [IntrNoMem, IntrSpeculatable, IntrWillReturn]>;
+                           [NonNull<RetIndex>, NonNull<ArgIndex<0>>, IntrNoMem, IntrSpeculatable, IntrWillReturn]>;
 
----------------



================
Comment at: llvm/utils/TableGen/IntrinsicEmitter.cpp:710-711
         unsigned AttrIdx = Intrinsic.ArgumentAttributes[Ai].Index;
-
+        if (AttrIdx == 0)
+          OS << "      // AttrParam0 corresponds to return value.\n";
         OS << "      const Attribute::AttrKind AttrParam" << AttrIdx << "[]= {";
----------------
Is this necessary? BTW, the comment specifier may be `;` instead of `//`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131872



More information about the cfe-commits mailing list