[PATCH] D91844: [llvm][clang] Add checks for the smart pointers with the possibility to be null

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 13:07:44 PST 2020


dexonsmith added a comment.

Is it possible to split these up into separate patches for unrelated code?



================
Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:1346-1353
   if (!Ptr) {
     // Search in reverse order so that the most-derived type is handled first.
     ArrayRef<std::pair<Record*, SMRange>> Bases = Search->getSuperClasses();
     for (const auto &Base : llvm::reverse(Bases)) {
       if ((Ptr = createArgument(Arg, Attr, Base.first)))
         break;
     }
----------------
Can we just add a single assertion here? It looks to me like every caller wants a valid return.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91844



More information about the llvm-commits mailing list