Changeset View
Changeset View
Standalone View
Standalone View
src/ClazyContext.h
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 61 | enum ClazyOption { | |||
---|---|---|---|---|---|
69 | ClazyOption_VisitImplicitCode = 64, // Inspect compiler generated code aswell, useful for custom checks, if they need it | 69 | ClazyOption_VisitImplicitCode = 64, // Inspect compiler generated code aswell, useful for custom checks, if they need it | ||
70 | ClazyOption_IgnoreIncludedFiles = 128 // Only warn for the current file being compiled, not on includes (useful for performance reasons) | 70 | ClazyOption_IgnoreIncludedFiles = 128 // Only warn for the current file being compiled, not on includes (useful for performance reasons) | ||
71 | }; | 71 | }; | ||
72 | typedef int ClazyOptions; | 72 | typedef int ClazyOptions; | ||
73 | 73 | | |||
74 | explicit ClazyContext(const clang::CompilerInstance &ci, | 74 | explicit ClazyContext(const clang::CompilerInstance &ci, | ||
75 | const std::string &headerFilter, | 75 | const std::string &headerFilter, | ||
76 | const std::string &ignoreDirs, | 76 | const std::string &ignoreDirs, | ||
77 | const std::string &exportFixes, | ||||
77 | ClazyOptions = ClazyOption_None); | 78 | ClazyOptions = ClazyOption_None); | ||
78 | ~ClazyContext(); | 79 | ~ClazyContext(); | ||
79 | 80 | | |||
80 | bool usingPreCompiledHeaders() const | 81 | bool usingPreCompiledHeaders() const | ||
81 | { | 82 | { | ||
82 | return !ci.getPreprocessorOpts().ImplicitPCHInclude.empty(); | 83 | return !ci.getPreprocessorOpts().ImplicitPCHInclude.empty(); | ||
83 | } | 84 | } | ||
84 | 85 | | |||
85 | bool userDisabledWError() const | 86 | bool userDisabledWError() const | ||
86 | { | 87 | { | ||
87 | return m_noWerror; | 88 | return m_noWerror; | ||
88 | } | 89 | } | ||
89 | 90 | | |||
90 | bool fixitsAreInplace() const | 91 | bool fixitsAreInplace() const | ||
91 | { | 92 | { | ||
92 | return !(options & ClazyOption_NoFixitsInplace); | 93 | return !(options & ClazyOption_NoFixitsInplace); | ||
93 | } | 94 | } | ||
94 | 95 | | |||
95 | bool fixitsEnabled() const | 96 | bool fixitsEnabled() const | ||
96 | { | 97 | { | ||
97 | return allFixitsEnabled || !requestedFixitName.empty(); | 98 | return allFixitsEnabled || !requestedFixitName.empty(); | ||
98 | } | 99 | } | ||
99 | 100 | | |||
101 | bool exportFixesEnabled() const | ||||
102 | { | ||||
103 | return !exportFixes.empty(); | ||||
104 | } | ||||
105 | | ||||
100 | bool isQtDeveloper() const | 106 | bool isQtDeveloper() const | ||
101 | { | 107 | { | ||
102 | return options & ClazyOption_QtDeveloper; | 108 | return options & ClazyOption_QtDeveloper; | ||
103 | } | 109 | } | ||
104 | 110 | | |||
105 | bool ignoresIncludedFiles() const | 111 | bool ignoresIncludedFiles() const | ||
106 | { | 112 | { | ||
107 | return options & ClazyOption_IgnoreIncludedFiles; | 113 | return options & ClazyOption_IgnoreIncludedFiles; | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | |||||
180 | const bool m_noWerror; | 186 | const bool m_noWerror; | ||
181 | clang::ParentMap *parentMap = nullptr; | 187 | clang::ParentMap *parentMap = nullptr; | ||
182 | const ClazyOptions options; | 188 | const ClazyOptions options; | ||
183 | const std::vector<std::string> extraOptions; | 189 | const std::vector<std::string> extraOptions; | ||
184 | clang::FixItRewriter *rewriter = nullptr; | 190 | clang::FixItRewriter *rewriter = nullptr; | ||
185 | FixItExporter *exporter = nullptr; | 191 | FixItExporter *exporter = nullptr; | ||
186 | bool allFixitsEnabled = false; | 192 | bool allFixitsEnabled = false; | ||
187 | std::string requestedFixitName; | 193 | std::string requestedFixitName; | ||
194 | std::string exportFixes; | ||||
188 | clang::CXXMethodDecl *lastMethodDecl = nullptr; | 195 | clang::CXXMethodDecl *lastMethodDecl = nullptr; | ||
189 | clang::FunctionDecl *lastFunctionDecl = nullptr; | 196 | clang::FunctionDecl *lastFunctionDecl = nullptr; | ||
190 | clang::Decl *lastDecl = nullptr; | 197 | clang::Decl *lastDecl = nullptr; | ||
191 | std::unique_ptr<llvm::Regex> headerFilterRegex; | 198 | std::unique_ptr<llvm::Regex> headerFilterRegex; | ||
192 | std::unique_ptr<llvm::Regex> ignoreDirsRegex; | 199 | std::unique_ptr<llvm::Regex> ignoreDirsRegex; | ||
193 | }; | 200 | }; | ||
194 | 201 | | |||
195 | #endif | 202 | #endif |