cppcheck-suppress unusedFunction
| 1923 | |
| 1924 | // cppcheck-suppress unusedFunction |
| 1925 | const Token* Library::getContainerFromAction(const Token* tok, Library::Container::Action action) const |
| 1926 | { |
| 1927 | if (!tok) |
| 1928 | return nullptr; |
| 1929 | if (Token::Match(tok->tokAt(-2), ". %name% (")) { |
| 1930 | const Token* containerTok = tok->tokAt(-2)->astOperand1(); |
| 1931 | if (!astIsContainer(containerTok)) |
| 1932 | return nullptr; |
| 1933 | if (containerTok->valueType()->container && |
| 1934 | containerTok->valueType()->container->getAction(tok->strAt(-1)) == action) |
| 1935 | return containerTok; |
| 1936 | if (Token::simpleMatch(tok->tokAt(-1), "empty ( )")) |
| 1937 | return containerTok; |
| 1938 | } else if (Token::Match(tok->previous(), "%name% (")) { |
| 1939 | if (const Library::Function* f = this->getFunction(tok->previous())) { |
| 1940 | if (f->containerAction == action) { |
| 1941 | return tok->astOperand2(); |
| 1942 | } |
| 1943 | } |
| 1944 | } |
| 1945 | return nullptr; |
| 1946 | } |
| 1947 | |
| 1948 | const std::unordered_map<std::string, Library::SmartPointer>& Library::smartPointers() const |
| 1949 | { |
nothing calls this directly
no test coverage detected