Bug 1410472 - clang-plugin follows the LLVM coding style for real r=mystor

MozReview-Commit-ID: AXrQEjWzxvg
This commit is contained in:
Sylvestre Ledru
2017-10-20 19:11:50 +02:00
parent 480c1a8de7
commit 173e982fb0
67 changed files with 601 additions and 667 deletions

View File

@@ -5,19 +5,16 @@
#include "AssertAssignmentChecker.h"
#include "CustomMatchers.h"
void AssertAssignmentChecker::registerMatchers(MatchFinder* AstMatcher) {
void AssertAssignmentChecker::registerMatchers(MatchFinder *AstMatcher) {
AstMatcher->addMatcher(
callExpr(isAssertAssignmentTestFunc()).bind("funcCall"),
this);
callExpr(isAssertAssignmentTestFunc()).bind("funcCall"), this);
}
void AssertAssignmentChecker::check(
const MatchFinder::MatchResult &Result) {
void AssertAssignmentChecker::check(const MatchFinder::MatchResult &Result) {
const CallExpr *FuncCall = Result.Nodes.getNodeAs<CallExpr>("funcCall");
if (FuncCall && hasSideEffectAssignment(FuncCall)) {
diag(FuncCall->getLocStart(),
"Forbidden assignment in assert expression",
diag(FuncCall->getLocStart(), "Forbidden assignment in assert expression",
DiagnosticIDs::Error);
}
}