Repository navigation
Expand file tree
/
Copy pathLambdaHandler.h
More file actions
44 lines (35 loc) · 1.61 KB
/
Copy pathLambdaHandler.h
File metadata and controls
44 lines (35 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/******************************************************************************
*
* C++ Insights, copyright (C) by Andreas Fertig
* Distributed under an MIT license. See LICENSE for details
*
****************************************************************************/
#ifndef INSIGHTS_LAMBDA_HANDLER_H
#define INSIGHTS_LAMBDA_HANDLER_H
//-----------------------------------------------------------------------------
#include "clang/AST/AST.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "InsightsBase.h"
//-----------------------------------------------------------------------------
namespace clang::insights {
/// \brief Show the transformation of a lambda to a class.
///
/// Transforms a lambda to the internal class representation with its members, mostly as described here:
/// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3559.pdf
class LambdaHandler final : public ast_matchers::MatchFinder::MatchCallback, public InsightsBase
{
public:
LambdaHandler(Rewriter& rewrite, ast_matchers::MatchFinder& matcher);
void run(const ast_matchers::MatchFinder::MatchResult& result) override;
private:
static void InsertMethod(const Decl* d,
OutputFormatHelper& outputFormatHelper,
const CXXMethodDecl& md,
bool /*skipConstexpr*/);
};
//-----------------------------------------------------------------------------
} // namespace clang::insights
#endif /* INSIGHTS_LAMBDA_HANDLER_H */