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 
12 namespace clang {
13 class ASTContext;
14 class 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.
27 extern const InsightsOptions& GetInsightsOptions();
29 //-----------------------------------------------------------------------------
30 
31 /// \brief Get access to the ASTContext
32 extern const clang::ASTContext& GetGlobalAST();
33 //-----------------------------------------------------------------------------
34 
35 /// \brief Get access to the CompilerInstance
36 extern const clang::CompilerInstance& GetGlobalCI();
37 //-----------------------------------------------------------------------------
38 
39 namespace clang::insights {
40 enum 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
53  FuncMalloc,
54  FuncFree,
55  FuncMemset,
56  FuncMemcpy,
63 
64  // The traditional enum element count
65  MAX
66 };
67 //-----------------------------------------------------------------------------
68 
70 //-----------------------------------------------------------------------------
71 } // namespace clang::insights
72 
73 #endif /* INSIGHTS_H */
InsightsOptions & GetInsightsOptionsRW()
Definition: Insights.cpp:43
const clang::ASTContext & GetGlobalAST()
Get access to the ASTContext.
Definition: Insights.cpp:81
const clang::CompilerInstance & GetGlobalCI()
Get access to the CompilerInstance.
Definition: Insights.cpp:88
const InsightsOptions & GetInsightsOptions()
Get the global C++ Insights options.
Definition: Insights.cpp:37
@ 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