Added support for call expressions tracking through lambdas in function arguments (#168)

This commit is contained in:
Bartek Kryza
2024-04-20 23:16:02 +02:00
parent 0fac87c27a
commit 9c07dbfde3
9 changed files with 452 additions and 44 deletions

View File

@@ -95,6 +95,8 @@ public:
bool TraverseLambdaExpr(clang::LambdaExpr *expr);
bool TraverseCXXMethodDecl(clang::CXXMethodDecl *declaration);
bool VisitCXXMethodDecl(clang::CXXMethodDecl *declaration);
bool VisitCXXRecordDecl(clang::CXXRecordDecl *declaration);
@@ -104,6 +106,8 @@ public:
bool VisitClassTemplateSpecializationDecl(
clang::ClassTemplateSpecializationDecl *declaration);
bool TraverseFunctionDecl(clang::FunctionDecl *declaration);
bool VisitFunctionDecl(clang::FunctionDecl *declaration);
bool VisitFunctionTemplateDecl(
@@ -336,6 +340,21 @@ private:
*/
std::string make_lambda_name(const clang::CXXRecordDecl *cls) const;
/**
* @brief Render lambda source location to string
*
* Returns exact source code location of the lambda expression in the form
* <filepath>:<line>:<column>.
*
* The filepath is relative to the `relative_to` config option.
*
* @param source_location Clang SourceLocation instance associated with
* lambda expression
* @return String representation of the location
*/
std::string lambda_source_location(
const clang::SourceLocation &source_location) const;
/**
* @brief Check if template is a smart pointer
*
@@ -441,6 +460,15 @@ private:
const clang::SourceManager &sm, const clang::ASTContext &context,
int64_t caller_id, const clang::Stmt *stmt);
/**
* @brief Initializes model message from comment call directive
*
* @param m Message instance
* @return True, if the comment associated with the call expression
* contained a call directive and it was parsed correctly.
*/
bool generate_message_from_comment(model::message &m) const;
/**
* @brief Get template builder reference
*