namespace clang {
namespace tidy {
+namespace llvm {
bool LLVMHeaderGuardCheck::shouldFixHeaderGuard(StringRef Filename) {
return Filename.endswith(".h");
return StringRef(Guard).upper();
}
+} // namespace llvm
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace llvm {
/// Finds and fixes header guards that do not adhere to LLVM style.
class LLVMHeaderGuardCheck : public HeaderGuardCheck {
std::string getHeaderGuard(StringRef Filename, StringRef OldGuard) override;
};
+} // namespace llvm
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace llvm {
namespace {
class IncludeOrderPPCallbacks : public PPCallbacks {
void IncludeOrderCheck::registerPPCallbacks(CompilerInstance &Compiler) {
Compiler.getPreprocessor().addPPCallbacks(
- llvm::make_unique<IncludeOrderPPCallbacks>(*this,
- Compiler.getSourceManager()));
+ ::llvm::make_unique<IncludeOrderPPCallbacks>(
+ *this, Compiler.getSourceManager()));
}
static int getPriority(StringRef Filename, bool IsAngled, bool IsMainModule) {
IncludeDirectives.clear();
}
+} // namespace llvm
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace llvm {
/// \brief Checks the correct order of \c #includes.
///
void registerPPCallbacks(CompilerInstance &Compiler) override;
};
+} // namespace llvm
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace llvm {
class LLVMModule : public ClangTidyModule {
public:
static ClangTidyModuleRegistry::Add<LLVMModule> X("llvm-module",
"Adds LLVM lint checks.");
+} // namespace llvm
+
// This anchor is used to force the linker to link in the generated object file
// and thus register the LLVMModule.
volatile int LLVMModuleAnchorSource = 0;
namespace clang {
namespace tidy {
+namespace llvm {
void TwineLocalCheck::registerMatchers(MatchFinder *Finder) {
auto TwineType =
}
}
+} // namespace llvm
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace llvm {
/// \brief Looks for local Twine variables which are prone to use after frees
/// and should be generally avoided.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace llvm
} // namespace tidy
} // namespace clang
#include "llvm/IncludeOrderCheck.h"
#include "gtest/gtest.h"
+using namespace clang::tidy::llvm;
+
namespace clang {
namespace tidy {
namespace test {