-
-
Save njames93/aac662ca52d345245e5e6f5dbc47d484 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClangTidyError : tooling::Diagnostic { | |
public: | |
ClangTidyError(StringRef CheckName, Level DiagLevel, StringRef BuildDirectory, | |
bool IsWarningAsError); | |
void setIsWarningAsError(bool Value = true) { | |
IsWarnErrorAndAlias.setInt(Value); | |
} | |
bool getIsWarningAsError() const { return IsWarnErrorAndAlias.getInt(); } | |
void addAliasName(std::string Alias) { | |
if (!IsWarnErrorAndAlias.getPointer()) | |
IsWarnErrorAndAlias.setPointer(new std::vector<std::string>()); | |
IsWarnErrorAndAlias.getPointer()->emplace_back(std::move(Alias)); | |
} | |
ArrayRef<std::string> getAliasNames() const { | |
if (!IsWarnErrorAndAlias.getPointer()) | |
return {}; | |
return *IsWarnErrorAndAlias.getPointer(); | |
} | |
~ClangTidyError() { delete IsWarnErrorAndAlias.getPointer(); } | |
private: | |
llvm::PointerIntPair<std::vector<std::string> *, 1, bool> IsWarnErrorAndAlias; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment