OikawaKirie created this revision. OikawaKirie added reviewers: dexonsmith, aaron.ballman, pcc. OikawaKirie added a project: clang. OikawaKirie requested review of this revision. Herald added a subscriber: cfe-commits.
Split from D91844 <https://reviews.llvm.org/D91844>. The return value of createArgument in file clang/utils/TableGen/ClangAttrEmitter.cpp. Although there are a lot of checks in the function, nullptr is still possible to be returned. In this patch, I added an assertion to confirm that. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D97251 Files: clang/utils/TableGen/ClangAttrEmitter.cpp Index: clang/utils/TableGen/ClangAttrEmitter.cpp =================================================================== --- clang/utils/TableGen/ClangAttrEmitter.cpp +++ clang/utils/TableGen/ClangAttrEmitter.cpp @@ -1361,6 +1361,8 @@ } } + assert(Ptr && "Cannot create argument."); + if (Ptr && Arg.getValueAsBit("Optional")) Ptr->setOptional(true);
Index: clang/utils/TableGen/ClangAttrEmitter.cpp =================================================================== --- clang/utils/TableGen/ClangAttrEmitter.cpp +++ clang/utils/TableGen/ClangAttrEmitter.cpp @@ -1361,6 +1361,8 @@ } } + assert(Ptr && "Cannot create argument."); + if (Ptr && Arg.getValueAsBit("Optional")) Ptr->setOptional(true);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits