{"id":377425,"date":"2024-05-29T15:00:15","date_gmt":"2024-05-29T15:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=377425"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=377425","title":{"rendered":"<span>\u041a\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0435\u0441\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 LLVM?<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>LLVM \u2014 open-source \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439. \u041b\u0443\u0447\u0448\u0438\u0439 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445, \u0435\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0434\u0430, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u044c. \u0412\u0435\u0434\u044c \u043a\u043e\u043c\u0443, \u043a\u0430\u043a \u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432, \u043b\u0443\u0447\u0448\u0435 \u0437\u043d\u0430\u0442\u044c \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u044f\u0437\u044b\u043a\u0430 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u0418\u0445 \u043a\u043e\u0434 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430 \u0432\u044b\u0441\u043e\u0442\u0435, \u0430 \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043d\u0451\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0437\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d6c\/812\/12a\/d6c81212a187c3c8c44c0a0a8087d27d.png\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d6c\/812\/12a\/d6c81212a187c3c8c44c0a0a8087d27d.png\"\/><\/figure>\n<p>\u041f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u0443 LLVM \u0432\u044b\u0448\u043b\u0430 \u0432 \u0440\u0435\u043b\u0438\u0437 18-\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0445 \u043a\u043e\u0434\u0430. \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0871\/\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1003\/\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0414\u043b\u044f <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/\">\u043d\u0430\u0441<\/a> \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u043e\u0431\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0432\u0435\u0434\u044c, \u043f\u043e \u0441\u0443\u0442\u0438, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0441\u0445\u043e\u0436\u0443\u044e \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0410 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u043b\u044f \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0432\u043e\u044e\u0440\u043e\u0434\u043d\u044b\u0435 \u0431\u0440\u0430\u0442\u044c\u044f. \u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0445\u043e\u0440\u043e\u0448 \u0432 \u0441\u0432\u043e\u0451\u043c \u0434\u0435\u043b\u0435. \u0414\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u043b\u0443\u0436\u0438\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043f\u0440\u0438\u0447\u0451\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u043b (\u043a\u0441\u0442\u0430\u0442\u0438, \u0438\u043c\u0435\u043d\u043d\u043e Clang, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 LLVM, \u0438 \u0443 \u043d\u0430\u0441 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0830\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u0441 MSVC). \u041d\u0443 \u0430 \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0448\u0451\u043b \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435. \u0427\u0435\u043c \u043d\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0441\u0438\u043d\u0435\u0440\u0433\u0438\u0438?<\/p>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f LLVM, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u2014 <a href=\"https:\/\/github.com\/llvm\/llvm-project\/tree\/llvmorg-18.1.0\">LLVM 18.1.0<\/a>.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u0435 \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0430\u044f \u043a \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u043e\u043c\u0443 \u043a\u043e\u0434\u0443.<\/p>\n<pre><code class=\"cpp\">if (Tok->is(tok::hash)) {   \/\/ Start of a macro expansion.   First = Tok;   Tok = Next;   if (Tok)     Tok = Tok->getNextNonComment(); } else if (Tok->is(tok::hashhash)) {   \/\/ Concatenation. Skip.   Tok = Next;   if (Tok)     Tok = Tok->getNextNonComment(); } else if (Keywords.isVerilogQualifier(*Tok) ||            Keywords.isVerilogIdentifier(*Tok)) {   First = Tok;   Tok = Next;   \/\/ The name may have dots like `interface_foo.modport_foo`.   while (Tok &amp;&amp; Tok->isOneOf(tok::period, tok::coloncolon) &amp;&amp;          (Tok = Tok->getNextNonComment())) {     if (Keywords.isVerilogIdentifier(*Tok))       Tok = Tok->getNextNonComment();   } } else if (!Next) {   Tok = nullptr; } else if (Tok->is(tok::l_paren)) {   \/\/ Make sure the parenthesized list is a drive strength. Otherwise the   \/\/ statement may be a module instantiation in which case we have already   \/\/ found the instance name.   if (Next->isOneOf(           Keywords.kw_highz0, Keywords.kw_highz1, Keywords.kw_large,           Keywords.kw_medium, Keywords.kw_pull0, Keywords.kw_pull1,           Keywords.kw_small, Keywords.kw_strong0, Keywords.kw_strong1,           Keywords.kw_supply0, Keywords.kw_supply1, Keywords.kw_weak0,           Keywords.kw_weak1)) {     Tok->setType(TT_VerilogStrength);     Tok = Tok->MatchingParen;     if (Tok) {       Tok->setType(TT_VerilogStrength);       Tok = Tok->getNextNonComment();     }   } else {     break;   } } else if (Tok->is(tok::hash)) {   if (Next->is(tok::l_paren))     Next = Next->MatchingParen;   if (Next)     Tok = Next->getNextNonComment(); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v517\/\">V517<\/a> The use of &#8216;if (A) {&#8230;} else if (A) {&#8230;}&#8217; pattern was detected. There is a probability of logical error presence. Check lines: <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Format\/TokenAnnotator.cpp#L3016\">3016<\/a>, <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Format\/TokenAnnotator.cpp#L3058\">3058<\/a>. TokenAnnotator.cpp<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>Tok->is(tok::hash)<\/em>. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <em>else if<\/em> \u0441\u0442\u043e\u0438\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u043e\u043a\u0435\u043d, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0434 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c <em>else if<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u0434 \u043f\u043e\u0434 \u044d\u0442\u0438\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u0439.<\/p>\n<pre><code class=\"cpp\">if (Tok->is(tok::hash)) {   \/\/ Start of a macro expansion.   First = Tok;   Tok = Next;   if (Tok)     Tok = Tok->getNextNonComment(); } else .... else if (Tok->is(tok::hash)) {   if (Next->is(tok::l_paren))     Next = Next->MatchingParen;   if (Next)     Tok = Next->getNextNonComment(); }<\/code><\/pre>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 <em>switch<\/em>, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0449\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0435\u043b\u043e \u0432\u043a\u0443\u0441\u0430.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2<\/h3>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0441 \u0432\u0430\u043c\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">assert(bArgs.size() == reduc.size() + needsUniv ? 1 : 0);<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v502\/\">V502<\/a> Perhaps the &#8216;?:&#8217; operator works in a different way than it was expected. The &#8216;?:&#8217; operator has a lower priority than the &#8216;+&#8217; operator. LoopEmitter.cpp <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/mlir\/lib\/Dialect\/SparseTensor\/Transforms\/Utils\/LoopEmitter.cpp#L983\">983<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v502\/\">V502<\/a> Perhaps the &#8216;?:&#8217; operator works in a different way than it was expected. The &#8216;?:&#8217; operator has a lower priority than the &#8216;+&#8217; operator. LoopEmitter.cpp <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/mlir\/lib\/Dialect\/SparseTensor\/Transforms\/Utils\/LoopEmitter.cpp#L1039\">1039<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u0432\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439: \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>+<\/em>, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>==<\/em>, \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>needsUniv<\/em> \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f <em>bool<\/em>.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b <em>reduc.size()<\/em> \u0438 <em>needsUniv<\/em>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c <em>needsUniv<\/em> \u043d\u0435\u044f\u0432\u043d\u043e \u043a\u0430\u0441\u0442\u0430\u043d\u0451\u0442\u0441\u044f \u043a \u0442\u0438\u043f\u0443 <em>size_t<\/em>. \u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0441\u044f \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b <em>bArgs.size()<\/em>. \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0451\u0442 \u043b\u0438\u0431\u043e 1, \u043b\u0438\u0431\u043e 0.<\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0432\u0430\u0442\u043e. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0445\u043e\u0442\u0435\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">assert(bArgs.size() == reduc.size() + (needsUniv ? 1 : 0));<\/code><\/pre>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0451\u0442 \u043b\u0438\u0431\u043e 1, \u043b\u0438\u0431\u043e 0. \u0417\u0430\u0442\u0435\u043c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u0438\u0442\u0441\u044f \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b *reduc.size(), *\u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b <em>bArgs.size()<\/em>.<\/p>\n<p>\u0417\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c, \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435.<\/p>\n<p>\u0415\u0449\u0451 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">assert(bArgs.size() == reduc.size() + needsUniv);<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u044b\u043b \u0431\u044b \u0442\u043e\u0442 \u0436\u0435, \u043d\u043e \u0443\u0436\u0435 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3<\/h3>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441\u043d\u043e\u0433\u043e \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430. \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>Printf<\/em>, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>strm<\/em>:<\/p>\n<pre><code class=\"cpp\">static void DumpTargetInfo(uint32_t target_idx, Target *target,                            const char *prefix_cstr,                            bool show_stopped_process_status, Stream &amp;strm)  {   ....   uint32_t properties = 0;   if (target_arch.IsValid())    {     strm.Printf(\"%sarch=\", properties++ > 0 ? \", \" : \" ( \");     target_arch.DumpTriple(strm.AsRawOstream());     properties++;   } }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;properties ++ > 0&#8217; is always false. CommandObjectTarget.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/lldb\/source\/Commands\/CommandObjectTarget.cpp#L100\">100<\/a><\/p>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0437\u0434\u0435\u0441\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 <em>properties<\/em> c \u043d\u0443\u043b\u0451\u043c, \u0438, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0439 \u043a\u043e\u0434 \u0441 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>properties<\/em>, \u0440\u0435\u0448\u0438\u043b\u0438 \u0442\u0443\u0442 \u0436\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441\u043d\u044b\u043c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u043e\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u0431\u044b \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443. \u041d\u043e \u0442\u043e\u0433\u0434\u0430 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0437\u0430\u0447\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0435\u0451 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u0440\u043e\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438.<\/p>\n<p>\u0410 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0431\u044b\u043b \u0432 \u0446\u0438\u043a\u043b\u0435. \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b N4-8<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio:<\/p>\n<pre><code class=\"cpp\">bool areStatementsIdentical(const Stmt *FirstStmt, const Stmt *SecondStmt,                             const ASTContext &amp;Context, bool Canonical)  {   ....   if (FirstStmt->getStmtClass() != FirstStmt->getStmtClass())     return false;   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;FirstStmt->getStmtClass()&#8217; to the left and to the right of the &#8216;!=&#8217; operator. ASTUtils.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang-tools-extra\/clang-tidy\/utils\/ASTUtils.cpp#L99\">99<\/a><\/p>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043c\u0435\u043b\u043e\u0447\u044c. \u041d\u0443 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b\u0438 <em>FirstStmt<\/em> \u0438 <em>SecondStmt,<\/em> \u0447\u0435\u0433\u043e \u0431\u0443\u0445\u0442\u0435\u0442\u044c-\u0442\u043e?<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">static bool sameFunctionParameterTypeLists(Sema &amp;S,                                            const OverloadCandidate &amp;Cand1,                                            const OverloadCandidate &amp;Cand2) {   if (!Cand1.Function || !Cand2.Function)     return false;    FunctionDecl *Fn1 = Cand1.Function;   FunctionDecl *Fn2 = Cand2.Function;    if (Fn1->isVariadic() != Fn1->isVariadic())     return false;   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions to the left and to the right of the &#8216;!=&#8217; operator: Fn1->isVariadic() != Fn1->isVariadic(). SemaOverload.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Sema\/SemaOverload.cpp#L10190\">10190<\/a><\/p>\n<p>\u0414\u0443\u043c\u0430\u0435\u0448\u044c: &#171;\u041d\u0443 \u043e\u0448\u0438\u0431\u043b\u0438\u0441\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437, \u0441 \u043a\u0435\u043c \u043d\u0435 \u0431\u044b\u0432\u0430\u0435\u0442&#187;.<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u0432\u0438\u0434\u0438\u0448\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">if (G1->Rank &lt; G1->Rank)   G1->Group = G2; else {   G2->Group = G1; }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions to the left and to the right of the &#8216;&lt;&#8216; operator: G1->Rank &lt; G1->Rank. SCCIterator.h:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/llvm\/include\/llvm\/ADT\/SCCIterator.h#L285\">285<\/a><\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0437\u0430\u043a\u0440\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"cpp\">ValueBoundsConstraintSet::areOverlappingSlices(MLIRContext *ctx,                                                HyperrectangularSlice slice1,                                                HyperrectangularSlice slice2) {   assert(slice1.getMixedOffsets().size() == slice1.getMixedOffsets().size()       &amp;&amp; \"expected slices of same rank\");   assert(slice1.getMixedSizes().size()   == slice1.getMixedSizes().size()        &amp;&amp; \"expected slices of same rank\");   assert(slice1.getMixedStrides().size() == slice1.getMixedStrides().size()        &amp;&amp; \"expected slices of same rank\");   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedOffsets().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/mlir\/lib\/Interfaces\/ValueBoundsOpInterface.cpp#L581\">581<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedSizes().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:583<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedStrides().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:585<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435:<\/p>\n<pre><code class=\"cpp\">ValueBoundsConstraintSet::areEquivalentSlices(MLIRContext *ctx,                                               HyperrectangularSlice slice1,                                               HyperrectangularSlice slice2) {   assert(slice1.getMixedOffsets().size() == slice1.getMixedOffsets().size()        &amp;&amp; \"expected slices of same rank\");   assert(slice1.getMixedSizes().size()   == slice1.getMixedSizes().size()        &amp;&amp; \"expected slices of same rank\");   assert(slice1.getMixedStrides().size() == slice1.getMixedStrides().size()        &amp;&amp; \"expected slices of same rank\");   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedOffsets().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/mlir\/lib\/Interfaces\/ValueBoundsOpInterface.cpp#L646\">646<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedSizes().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:648<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedStrides().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:650<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0443\u0434\u0438\u0432\u043b\u044f\u0435\u0448\u044c\u0441\u044f: \u043d\u0435\u0443\u0436\u0435\u043b\u0438 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0442\u0438\u0445\u043e \u0436\u0438\u0442\u044c \u0432 \u043a\u043e\u0434\u0435? \u0418 \u0432\u0435\u0434\u044c \u0438\u0437-\u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0441\u0442 \u0447\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0432\u0430\u043b\u0438\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0432\u0438\u0434\u044f \u0432\u0441\u0435 \u044d\u0442\u0438 <em>Fn1<\/em>, <em>G1<\/em>, <em>slice1<\/em>, \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043a\u043e\u043b\u043b\u0435\u0433\u0438 &#171;<a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0713\/\">\u041d\u043e\u043b\u044c, \u043e\u0434\u0438\u043d, \u0434\u0432\u0430, \u0424\u0440\u0435\u0434\u0434\u0438 \u0437\u0430\u0431\u0435\u0440\u0451\u0442 \u0442\u0435\u0431\u044f<\/a>&#171;.<\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0430 \u0437\u0430\u043a\u0443\u0441\u043a\u0443 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;EltRange.getEnd() >= Range.getEnd()&#8217; to the left and to the right of the &#8216;||&#8217; operator. HTMLLogger.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Analysis\/FlowSensitive\/HTMLLogger.cpp#L421\">421<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;SrcExpr.get()->containsErrors()&#8217; to the left and to the right of the &#8216;||&#8217; operator. SemaCast.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Sema\/SemaCast.cpp#L2938\">2938<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;ND->getDeclContext()&#8217; to the left and to the right of the &#8216;!=&#8217; operator. SemaDeclCXX.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Sema\/SemaDeclCXX.cpp#L4391\">4391<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;DepType != OMPC_DOACROSS_source&#8217; to the left and to the right of the &#8216;&amp;&amp;&#8217; operator. SemaOpenMP.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Sema\/SemaOpenMP.cpp#L24348\">24348<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;!OldMethod->isStatic()&#8217; to the left and to the right of the &#8216;&amp;&amp;&#8217; operator. SemaOverload.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Sema\/SemaOverload.cpp#L1425\">1425<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;lldb::eTypeClassUnion&#8217; to the left and to the right of the &#8216;|&#8217; operator. JSONUtils.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/lldb\/tools\/lldb-dap\/JSONUtils.cpp#L139\">139<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions to the left and to the right of the &#8216;&amp;&amp;&#8217; operator: !BFI &amp;&amp;!BFI. JumpThreading.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/llvm\/lib\/Transforms\/Scalar\/JumpThreading.cpp#L2531\">2531<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;BI->isConditional()&#8217; to the left and to the right of the &#8216;&amp;&amp;&#8217; operator. VPlanHCFGBuilder.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/llvm\/lib\/Transforms\/Vectorize\/VPlanHCFGBuilder.cpp#L401\">401<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions to the left and to the right of the &#8216;==&#8217; operator: getNumRows() == getNumRows(). Simplex.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/mlir\/lib\/Analysis\/Presburger\/Simplex.cpp#L108\">108<\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N9<\/h3>\n<p>\u0410 \u0432\u043e\u0442 \u0435\u0449\u0451 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0433\u0434\u0435 \u0442\u0443\u0442 \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">const Expr *CGOpenMPRuntime::getNumTeamsExprForTargetDirective(     CodeGenFunction &amp;CGF, const OMPExecutableDirective &amp;D, int32_t &amp;MinTeamsVal,     int32_t &amp;MaxTeamsVal)  {   ....   if (isOpenMPParallelDirective(NestedDir->getDirectiveKind()) ||           isOpenMPSimdDirective(NestedDir->getDirectiveKind())) {     MinTeamsVal = MaxTeamsVal = 1;     return nullptr;   }   MinTeamsVal = MaxTeamsVal = 1;   return nullptr;   .... }<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v523\/\">V523<\/a> The &#8216;then&#8217; statement is equivalent to the subsequent code fragment. CGOpenMPRuntime.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/CodeGen\/CGOpenMPRuntime.cpp#L6040\">6040<\/a>, <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/CodeGen\/CGOpenMPRuntime.cpp#L6036\">6036<\/a><\/p>\n<p>\u041e\u043d \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 <em>if<\/em> \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 <em>then<\/em>-\u0432\u0435\u0442\u043a\u0435. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u043d\u044f\u044f \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043b\u0438\u0431\u043e \u0436\u0435 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0451.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N10<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u043e:<\/p>\n<pre><code class=\"cpp\">explicit MapLattice(Container C) { C = std::move(C); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v570\/\">V570<\/a> The &#8216;C&#8217; variable is assigned to itself. MapLattice.h:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/include\/clang\/Analysis\/FlowSensitive\/MapLattice.h#L52\">52<\/a><\/p>\n<p>\u0418 \u043d\u0435\u0441\u043f\u0440\u043e\u0441\u0442\u0430. \u0412\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043b\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 MapLattice \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e <a href=\"https:\/\/en.wikipedia.org\/wiki\/Variable_shadowing\">\u0441\u043e\u043a\u0440\u044b\u0442\u0438\u0435<\/a> \u043d\u0435\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0441 \u0442\u0435\u043c \u0436\u0435 \u0438\u043c\u0435\u043d\u0435\u043c, \u0447\u0442\u043e \u0438 \u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u0418 \u0432 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0437\u0430\u0431\u044b\u043b\u0438 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <em>this<\/em> \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u0430\u0432\u043a\u0430, \u0438 \u043a\u043e\u0434 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a, \u043a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c:<\/p>\n<pre><code class=\"cpp\">explicit MapLattice(Container C) { this->C = std::move(C); }<\/code><\/pre>\n<p>\u0425\u043e\u0442\u044f, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043a\u0443\u0434\u0430 \u0438\u0437\u044f\u0449\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">explicit MapLattice(Container C) : C { std::move(C) } {};<\/code><\/pre>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437-\u0437\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043c\u0451\u043d (<a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/class.init#class.base.init-2\">\u0442\u044b\u043a<\/a>, <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4950\/class.init#class.base.init-15\">\u0442\u044b\u043a<\/a>).<\/p>\n<p>\u041d\u0443 \u0430 \u0432\u043e\u043e\u0431\u0449\u0435, \u0432 \u0438\u043c\u0435\u043d\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0438\u043b\u0438 \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u0447\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u0434\u0435 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N11<\/h3>\n<p>\u0423 \u0432\u0430\u0441 \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u043e, \u0431\u0443\u0434\u0442\u043e \u0432\u044b \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438? \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043d\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0432\u0437\u044f\u043b\u0438 \u043b\u0438 \u0432\u044b \u0441 \u0441\u043e\u0431\u043e\u0439 \u043a\u043b\u044e\u0447\u0438. \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u043e\u0449\u0443\u043f\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u043c\u0430\u043d\u044b \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0438\u0445.<\/p>\n<p>\u0422\u0430\u043a \u0432\u043e\u0442, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">ScalarEvolution::getRangeRefIter(const SCEV *S,                                  ScalarEvolution::RangeSignHint SignHint)  {   ....   for (const SCEV *P : reverse(drop_begin(WorkList))) {     getRangeRef(P, SignHint);     ....   }   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v530\/\">V530<\/a> The return value of function &#8216;getRangeRef&#8217; is required to be utilized. ScalarEvolution.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/llvm\/lib\/Analysis\/ScalarEvolution.cpp#L6587\">6587<\/a><\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b <em>getRangeRef<\/em> \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0435\u0441\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">const ConstantRange &amp;getRangeRef(const SCEV *S, RangeSignHint Hint,                                  unsigned Depth = 0);<\/code><\/pre>\n<p>\u0414\u0430 \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0435\u0451 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041d\u043e \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e. \u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u0448\u0438 \u0447\u0443\u0432\u0441\u0442\u0432\u0430 \u043d\u0430\u0441 \u043f\u043e\u0434\u0432\u043e\u0434\u044f\u0442 \u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u043b\u044e\u0447\u0438 \u0432\u0441\u0451 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0431\u044b\u043b\u0438 \u043f\u0440\u044f\u043c\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0440\u0443\u043a\u0435.<\/p>\n<p>\u041d\u0430\u0434 \u0441\u0430\u043c\u0438\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">\/\/ Use getRangeRef to compute ranges for items in the worklist in reverse \/\/ order. This will force ranges for earlier operands to be computed before \/\/ their users in most cases.<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. \u0414\u0440\u0443\u0433\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <em>get<\/em> \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u2014 \u043f\u043b\u043e\u0445\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0440\u0430\u0432, \u043d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442. \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u0432 \u043a\u043e\u0434\u0435:<\/p>\n<pre><code class=\"cpp\">for (const SCEV *P : reverse(drop_begin(WorkList))) {   getRangeRef(P, SignHint); \/\/-V530   .... }  <\/code><\/pre>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N12<\/h3>\n<p>\u0414\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445. \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0442\u0440\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 <em>if<\/em> \u0438 <em>else<\/em> \u0432\u0435\u0442\u043a\u0430\u0445. \u041b\u0430\u0434\u043d\u043e, \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e:<\/p>\n<pre><code class=\"cpp\">case OptionParser::eOptionalArgument:   if (OptionParser::GetOptionArgument() != nullptr) {     option_element_vector.push_back(OptionArgElement(         opt_defs_index,         FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 2],                           args),         FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],                           args)));   } else {     option_element_vector.push_back(OptionArgElement(         opt_defs_index,         FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 2],                           args),         FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],                           args)));   }<\/code><\/pre>\n<p>\u0418 \u0432\u044b \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u0430\u0432\u044b. \u0418\u0445 \u043d\u0435\u0442.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v523\/\">V523<\/a> The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. Options.cpp <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/lldb\/source\/Interpreter\/Options.cpp#L1212\">1212<\/a><\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041d\u043e \u043a \u0441\u0442\u0430\u0442\u044c\u0435 \u044d\u0442\u043e \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f. \u0411\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u2014 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u0430 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435 \u0434\u0432\u0435. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043e\u0448\u0438\u0431\u043a\u0438 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0435\u0435, \u0447\u0435\u043c \u0432 \u044d\u0442\u043e\u0439 (\u0441\u043f\u043e\u0439\u043b\u0435\u0440: \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 UB).<\/p>\n<p>\u0414\u0430\u0436\u0435 \u043b\u0443\u0447\u0448\u0438\u0435 \u0438\u0437 \u043d\u0430\u0441 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u0434\u0435). \u0427\u0442\u043e \u0443\u0436 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e \u0440\u044f\u0434\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041d\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043e\u0434 \u0440\u0430\u0441\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041e\u0448\u0438\u0431\u043a\u0438 \u2014 \u044d\u0442\u043e \u043f\u043e\u0432\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043b\u0443\u0447\u0448\u0435 \u0438 \u0440\u0430\u0441\u0442\u0438 (\u043c\u043e\u0436\u0435\u0442\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0442\u0438\u043c\u043b\u0438\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u043e\u0442\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0434\u0435).<\/p>\n<p>\u041d\u0443 \u0430 \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043a\u043e\u0434\u0435, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0445 \u043f\u043e\u0438\u0441\u043a\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043c\u0438\u043c\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u043a\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 code review \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0435\u0441\u0442\u044c \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435? \u0422\u043e\u0433\u0434\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/0614\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Alexey Smolskas. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/1126\/\">What errors are lurking in LLVM code?<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/817963\/\"> https:\/\/habr.com\/ru\/articles\/817963\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>LLVM \u2014 open-source \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439. \u041b\u0443\u0447\u0448\u0438\u0439 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445, \u0435\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0434\u0430, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u044c. \u0412\u0435\u0434\u044c \u043a\u043e\u043c\u0443, \u043a\u0430\u043a \u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432, \u043b\u0443\u0447\u0448\u0435 \u0437\u043d\u0430\u0442\u044c \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u044f\u0437\u044b\u043a\u0430 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u0418\u0445 \u043a\u043e\u0434 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430 \u0432\u044b\u0441\u043e\u0442\u0435, \u0430 \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043d\u0451\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0437\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u0443 LLVM \u0432\u044b\u0448\u043b\u0430 \u0432 \u0440\u0435\u043b\u0438\u0437 18-\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0445 \u043a\u043e\u0434\u0430. \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0871\/\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1003\/\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0414\u043b\u044f <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/\">\u043d\u0430\u0441<\/a> \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u043e\u0431\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0432\u0435\u0434\u044c, \u043f\u043e \u0441\u0443\u0442\u0438, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0441\u0445\u043e\u0436\u0443\u044e \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0410 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u043b\u044f \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0432\u043e\u044e\u0440\u043e\u0434\u043d\u044b\u0435 \u0431\u0440\u0430\u0442\u044c\u044f. \u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0445\u043e\u0440\u043e\u0448 \u0432 \u0441\u0432\u043e\u0451\u043c \u0434\u0435\u043b\u0435. \u0414\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u043b\u0443\u0436\u0438\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043f\u0440\u0438\u0447\u0451\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u043b (\u043a\u0441\u0442\u0430\u0442\u0438, \u0438\u043c\u0435\u043d\u043d\u043e Clang, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 LLVM, \u0438 \u0443 \u043d\u0430\u0441 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0830\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u0441 MSVC). \u041d\u0443 \u0430 \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0448\u0451\u043b \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435. \u0427\u0435\u043c \u043d\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0441\u0438\u043d\u0435\u0440\u0433\u0438\u0438?<\/p>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f LLVM, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u2014 <a href=\"https:\/\/github.com\/llvm\/llvm-project\/tree\/llvmorg-18.1.0\">LLVM 18.1.0<\/a>.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u0435 \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0430\u044f \u043a \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u043e\u043c\u0443 \u043a\u043e\u0434\u0443.<\/p>\n<pre><code class=\"cpp\">if (Tok->is(tok::hash)) {   \/\/ Start of a macro expansion.   First = Tok;   Tok = Next;   if (Tok)     Tok = Tok->getNextNonComment(); } else if (Tok->is(tok::hashhash)) {   \/\/ Concatenation. Skip.   Tok = Next;   if (Tok)     Tok = Tok->getNextNonComment(); } else if (Keywords.isVerilogQualifier(*Tok) ||            Keywords.isVerilogIdentifier(*Tok)) {   First = Tok;   Tok = Next;   \/\/ The name may have dots like `interface_foo.modport_foo`.   while (Tok &amp;&amp; Tok->isOneOf(tok::period, tok::coloncolon) &amp;&amp;          (Tok = Tok->getNextNonComment())) {     if (Keywords.isVerilogIdentifier(*Tok))       Tok = Tok->getNextNonComment();   } } else if (!Next) {   Tok = nullptr; } else if (Tok->is(tok::l_paren)) {   \/\/ Make sure the parenthesized list is a drive strength. Otherwise the   \/\/ statement may be a module instantiation in which case we have already   \/\/ found the instance name.   if (Next->isOneOf(           Keywords.kw_highz0, Keywords.kw_highz1, Keywords.kw_large,           Keywords.kw_medium, Keywords.kw_pull0, Keywords.kw_pull1,           Keywords.kw_small, Keywords.kw_strong0, Keywords.kw_strong1,           Keywords.kw_supply0, Keywords.kw_supply1, Keywords.kw_weak0,           Keywords.kw_weak1)) {     Tok->setType(TT_VerilogStrength);     Tok = Tok->MatchingParen;     if (Tok) {       Tok->setType(TT_VerilogStrength);       Tok = Tok->getNextNonComment();     }   } else {     break;   } } else if (Tok->is(tok::hash)) {   if (Next->is(tok::l_paren))     Next = Next->MatchingParen;   if (Next)     Tok = Next->getNextNonComment(); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v517\/\">V517<\/a> The use of &#8216;if (A) {&#8230;} else if (A) {&#8230;}&#8217; pattern was detected. There is a probability of logical error presence. Check lines: <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Format\/TokenAnnotator.cpp#L3016\">3016<\/a>, <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Format\/TokenAnnotator.cpp#L3058\">3058<\/a>. TokenAnnotator.cpp<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>Tok->is(tok::hash)<\/em>. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <em>else if<\/em> \u0441\u0442\u043e\u0438\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u043e\u043a\u0435\u043d, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0434 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c <em>else if<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u0434 \u043f\u043e\u0434 \u044d\u0442\u0438\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u0439.<\/p>\n<pre><code class=\"cpp\">if (Tok->is(tok::hash)) {   \/\/ Start of a macro expansion.   First = Tok;   Tok = Next;   if (Tok)     Tok = Tok->getNextNonComment(); } else .... else if (Tok->is(tok::hash)) {   if (Next->is(tok::l_paren))     Next = Next->MatchingParen;   if (Next)     Tok = Next->getNextNonComment(); }<\/code><\/pre>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 <em>switch<\/em>, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0449\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0435\u043b\u043e \u0432\u043a\u0443\u0441\u0430.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2<\/h3>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0441 \u0432\u0430\u043c\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">assert(bArgs.size() == reduc.size() + needsUniv ? 1 : 0);<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v502\/\">V502<\/a> Perhaps the &#8216;?:&#8217; operator works in a different way than it was expected. The &#8216;?:&#8217; operator has a lower priority than the &#8216;+&#8217; operator. LoopEmitter.cpp <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/mlir\/lib\/Dialect\/SparseTensor\/Transforms\/Utils\/LoopEmitter.cpp#L983\">983<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v502\/\">V502<\/a> Perhaps the &#8216;?:&#8217; operator works in a different way than it was expected. The &#8216;?:&#8217; operator has a lower priority than the &#8216;+&#8217; operator. LoopEmitter.cpp <a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/mlir\/lib\/Dialect\/SparseTensor\/Transforms\/Utils\/LoopEmitter.cpp#L1039\">1039<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u0432\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439: \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>+<\/em>, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>==<\/em>, \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>needsUniv<\/em> \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f <em>bool<\/em>.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b <em>reduc.size()<\/em> \u0438 <em>needsUniv<\/em>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c <em>needsUniv<\/em> \u043d\u0435\u044f\u0432\u043d\u043e \u043a\u0430\u0441\u0442\u0430\u043d\u0451\u0442\u0441\u044f \u043a \u0442\u0438\u043f\u0443 <em>size_t<\/em>. \u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0441\u044f \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b <em>bArgs.size()<\/em>. \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0451\u0442 \u043b\u0438\u0431\u043e 1, \u043b\u0438\u0431\u043e 0.<\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0432\u0430\u0442\u043e. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0445\u043e\u0442\u0435\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">assert(bArgs.size() == reduc.size() + (needsUniv ? 1 : 0));<\/code><\/pre>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0451\u0442 \u043b\u0438\u0431\u043e 1, \u043b\u0438\u0431\u043e 0. \u0417\u0430\u0442\u0435\u043c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u0438\u0442\u0441\u044f \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b *reduc.size(), *\u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b <em>bArgs.size()<\/em>.<\/p>\n<p>\u0417\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c, \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435.<\/p>\n<p>\u0415\u0449\u0451 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">assert(bArgs.size() == reduc.size() + needsUniv);<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u044b\u043b \u0431\u044b \u0442\u043e\u0442 \u0436\u0435, \u043d\u043e \u0443\u0436\u0435 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3<\/h3>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441\u043d\u043e\u0433\u043e \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430. \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>Printf<\/em>, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>strm<\/em>:<\/p>\n<pre><code class=\"cpp\">static void DumpTargetInfo(uint32_t target_idx, Target *target,                            const char *prefix_cstr,                            bool show_stopped_process_status, Stream &amp;strm)  {   ....   uint32_t properties = 0;   if (target_arch.IsValid())    {     strm.Printf(\"%sarch=\", properties++ > 0 ? \", \" : \" ( \");     target_arch.DumpTriple(strm.AsRawOstream());     properties++;   } }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;properties ++ > 0&#8217; is always false. CommandObjectTarget.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/lldb\/source\/Commands\/CommandObjectTarget.cpp#L100\">100<\/a><\/p>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0437\u0434\u0435\u0441\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 <em>properties<\/em> c \u043d\u0443\u043b\u0451\u043c, \u0438, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0439 \u043a\u043e\u0434 \u0441 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>properties<\/em>, \u0440\u0435\u0448\u0438\u043b\u0438 \u0442\u0443\u0442 \u0436\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441\u043d\u044b\u043c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u043e\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u0431\u044b \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443. \u041d\u043e \u0442\u043e\u0433\u0434\u0430 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0437\u0430\u0447\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0435\u0451 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u0440\u043e\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438.<\/p>\n<p>\u0410 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0431\u044b\u043b \u0432 \u0446\u0438\u043a\u043b\u0435. \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b N4-8<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio:<\/p>\n<pre><code class=\"cpp\">bool areStatementsIdentical(const Stmt *FirstStmt, const Stmt *SecondStmt,                             const ASTContext &amp;Context, bool Canonical)  {   ....   if (FirstStmt->getStmtClass() != FirstStmt->getStmtClass())     return false;   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;FirstStmt->getStmtClass()&#8217; to the left and to the right of the &#8216;!=&#8217; operator. ASTUtils.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang-tools-extra\/clang-tidy\/utils\/ASTUtils.cpp#L99\">99<\/a><\/p>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043c\u0435\u043b\u043e\u0447\u044c. \u041d\u0443 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b\u0438 <em>FirstStmt<\/em> \u0438 <em>SecondStmt,<\/em> \u0447\u0435\u0433\u043e \u0431\u0443\u0445\u0442\u0435\u0442\u044c-\u0442\u043e?<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">static bool sameFunctionParameterTypeLists(Sema &amp;S,                                            const OverloadCandidate &amp;Cand1,                                            const OverloadCandidate &amp;Cand2) {   if (!Cand1.Function || !Cand2.Function)     return false;    FunctionDecl *Fn1 = Cand1.Function;   FunctionDecl *Fn2 = Cand2.Function;    if (Fn1->isVariadic() != Fn1->isVariadic())     return false;   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions to the left and to the right of the &#8216;!=&#8217; operator: Fn1->isVariadic() != Fn1->isVariadic(). SemaOverload.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/clang\/lib\/Sema\/SemaOverload.cpp#L10190\">10190<\/a><\/p>\n<p>\u0414\u0443\u043c\u0430\u0435\u0448\u044c: &#171;\u041d\u0443 \u043e\u0448\u0438\u0431\u043b\u0438\u0441\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437, \u0441 \u043a\u0435\u043c \u043d\u0435 \u0431\u044b\u0432\u0430\u0435\u0442&#187;.<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u0432\u0438\u0434\u0438\u0448\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">if (G1->Rank &lt; G1->Rank)   G1->Group = G2; else {   G2->Group = G1; }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions to the left and to the right of the &#8216;&lt;&#8216; operator: G1->Rank &lt; G1->Rank. SCCIterator.h:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/llvm\/include\/llvm\/ADT\/SCCIterator.h#L285\">285<\/a><\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0437\u0430\u043a\u0440\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"cpp\">ValueBoundsConstraintSet::areOverlappingSlices(MLIRContext *ctx,                                                HyperrectangularSlice slice1,                                                HyperrectangularSlice slice2) {   assert(slice1.getMixedOffsets().size() == slice1.getMixedOffsets().size()       &amp;&amp; \"expected slices of same rank\");   assert(slice1.getMixedSizes().size()   == slice1.getMixedSizes().size()        &amp;&amp; \"expected slices of same rank\");   assert(slice1.getMixedStrides().size() == slice1.getMixedStrides().size()        &amp;&amp; \"expected slices of same rank\");   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedOffsets().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:<a href=\"https:\/\/github.com\/llvm\/llvm-project\/blob\/461274b81d8641eab64d494accddc81d7db8a09e\/mlir\/lib\/Interfaces\/ValueBoundsOpInterface.cpp#L581\">581<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedSizes().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:583<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions &#8216;slice1.getMixedStrides().size()&#8217; to the left and to the right of the &#8216;==&#8217; operator. ValueBoundsOpInterface.cpp:585<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435:<\/p>\n<pre><code class=\"cpp\">ValueBoundsConstraintSet::areEquivalentSlices(MLIRContext *ctx,                                               HyperrectangularSlice slice1,                                               HyperrectangularSlice slice2) {   assert(slice1.getMixedOffsets().size() == slice1.getMixedOffsets().size()        &amp;&amp; \"expected slices of same rank\");   assert(slice1.getMixedSizes().size()   == slice1.getMixedSizes().size()        &amp;&amp; \"expected slices of same rank\");<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-377425","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=377425"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377425\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=377425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=377425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=377425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}