Insights.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// C++ Insights, copyright (C) by Andreas Fertig
4// Distributed under an MIT license. See LICENSE for details
5//
6///////////////////////////////////////////////////////////////////////////////
7
8#ifndef INSIGHTS_H
9#define INSIGHTS_H
10//-----------------------------------------------------------------------------
11
12namespace clang {
13class ASTContext;
14class CompilerInstance;
15} // namespace clang
16//-----------------------------------------------------------------------------
17
18/// \brief Global C++ Insights command line options.
20{
21#define INSIGHTS_OPT(opt, name, deflt, description, category) bool name;
22#include "InsightsOptions.def"
23};
24//-----------------------------------------------------------------------------
25
26/// \brief Get the global C++ Insights options.
29//-----------------------------------------------------------------------------
30
31/// \brief Get access to the ASTContext
32extern const clang::ASTContext& GetGlobalAST();
33//-----------------------------------------------------------------------------
34
35/// \brief Get access to the CompilerInstance
36extern const clang::CompilerInstance& GetGlobalCI();
37//-----------------------------------------------------------------------------
38
39namespace clang::insights {
40enum class GlobalInserts
41{ // Headers go first
42 HeaderNew, //!< Track whether we have at least one local static variable in this TU. If so we need to insert the
43 //!< <new> header for the placement-new.
44 HeaderException, //!< Track whether there was a noexcept transformation requireing the exception header.
45 HeaderUtility, //!< Track whether there was a std::move inserted.
46 HeaderStddef, //!< Track whether we need to insert <stddef.h> in Cfront mode
47 HeaderAssert, //!< Track whether we need to insert <assert.h> in Cfront mode
48 HeaderStdlib, //!< Track whether we need to insert <stdlib.h> in Cfront mode
49
50 // Now all the forward declared functions
63
64 // The traditional enum element count
65 MAX
66};
67//-----------------------------------------------------------------------------
68
70//-----------------------------------------------------------------------------
71} // namespace clang::insights
72
73#endif /* INSIGHTS_H */
const InsightsOptions & GetInsightsOptions()
Get the global C++ Insights options.
Definition Insights.cpp:37
const clang::ASTContext & GetGlobalAST()
Get access to the ASTContext.
Definition Insights.cpp:81
InsightsOptions & GetInsightsOptionsRW()
Definition Insights.cpp:43
const clang::CompilerInstance & GetGlobalCI()
Get access to the CompilerInstance.
Definition Insights.cpp:88
@ HeaderStdlib
Track whether we need to insert <stdlib.h> in Cfront mode.
@ HeaderUtility
Track whether there was a std::move inserted.
@ HeaderAssert
Track whether we need to insert <assert.h> in Cfront mode.
@ HeaderException
Track whether there was a noexcept transformation requireing the exception header.
@ HeaderStddef
Track whether we need to insert <stddef.h> in Cfront mode.
void EnableGlobalInsert(GlobalInserts idx)
Definition Insights.cpp:106
Global C++ Insights command line options.
Definition Insights.h:20