| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2023 Johnny Jazeix <[email protected]> |
| 3 |
|
| 4 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef CLAZY_NO_MODULE_INCLUDE_H |
| 8 |
#define CLAZY_NO_MODULE_INCLUDE_H |
| 9 |
|
| 10 |
#include "checkbase.h" |
| 11 |
|
| 12 |
#include <string> |
| 13 |
#include <vector> |
| 14 |
|
| 15 |
/** |
| 16 |
* See README-no-module-include.md for more info. |
| 17 |
*/ |
| 18 |
class NoModuleInclude : public CheckBase |
| 19 |
{ |
| 20 |
public: |
| 21 |
explicit NoModuleInclude(const std::string &name, Options options); |
| 22 |
void VisitInclusionDirective(clang::SourceLocation HashLoc, |
| 23 |
const clang::Token &IncludeTok, |
| 24 |
clang::StringRef FileName, |
| 25 |
bool IsAngled, |
| 26 |
clang::CharSourceRange FilenameRange, |
| 27 |
clazy::OptionalFileEntryRef File, |
| 28 |
clang::StringRef SearchPath, |
| 29 |
clang::StringRef RelativePath, |
| 30 |
const clang::Module *SuggestedModule, |
| 31 |
bool ModuleImported, |
| 32 |
clang::SrcMgr::CharacteristicKind FileType) override; |
| 33 |
|
| 34 |
private: |
| 35 |
const std::vector<std::string> m_modulesList; |
| 36 |
}; |
| 37 |
|
| 38 |
#endif |