aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp6
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp2
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp6
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp5
4 files changed, 9 insertions, 10 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
index 475cee9ce04b..6955efe8e6c2 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
@@ -1517,7 +1517,7 @@ void CStringChecker::evalStrcat(CheckerContext &C, const CallExpr *CE) const {
}
void CStringChecker::evalStrncat(CheckerContext &C, const CallExpr *CE) const {
- //char *strncat(char *restrict s1, const char *restrict s2, size_t n);
+ // char *strncat(char *restrict s1, const char *restrict s2, size_t n);
evalStrcpyCommon(C, CE,
/* ReturnEnd = */ false,
/* IsBounded = */ true,
@@ -2069,8 +2069,8 @@ void CStringChecker::evalStrcmpCommon(CheckerContext &C, const CallExpr *CE,
}
void CStringChecker::evalStrsep(CheckerContext &C, const CallExpr *CE) const {
- //char *strsep(char **stringp, const char *delim);
- // Sanity: does the search string parameter match the return type?
+ // char *strsep(char **stringp, const char *delim);
+ // Verify whether the search string parameter matches the return type.
SourceArgExpr SearchStrPtr = {CE->getArg(0), 0};
QualType CharPtrTy = SearchStrPtr.Expression->getType()->getPointeeType();
diff --git a/clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
index 5bf96acc0462..139bc0e99d78 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
@@ -160,7 +160,7 @@ static bool isInMIGCall(CheckerContext &C) {
if (Optional<AnyCall> AC = AnyCall::forDecl(D)) {
// Even though there's a Sema warning when the return type of an annotated
// function is not a kern_return_t, this warning isn't an error, so we need
- // an extra sanity check here.
+ // an extra check here.
// FIXME: AnyCall doesn't support blocks yet, so they remain unchecked
// for now.
if (!AC->getReturnType(C.getASTContext())
diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
index e8b963a535d8..5a8edcabda71 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
@@ -155,7 +155,7 @@ class StdLibraryFunctionsChecker
protected:
ArgNo ArgN; // Argument to which we apply the constraint.
- /// Do polymorphic sanity check on the constraint.
+ /// Do polymorphic validation check on the constraint.
virtual bool checkSpecificValidity(const FunctionDecl *FD) const {
return true;
}
@@ -527,8 +527,8 @@ class StdLibraryFunctionsChecker
}
private:
- // Once we know the exact type of the function then do sanity check on all
- // the given constraints.
+ // Once we know the exact type of the function then do validation check on
+ // all the given constraints.
bool validateByConstraints(const FunctionDecl *FD) const {
for (const ConstraintSet &Case : CaseConstraints)
for (const ValueConstraintPtr &Constraint : Case)
diff --git a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
index 2244cdb96d4f..41adc36b021a 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
@@ -182,8 +182,7 @@ void UnixAPIMisuseChecker::CheckOpenVariant(CheckerContext &C,
ProgramStateRef state = C.getState();
if (CE->getNumArgs() < MinArgCount) {
- // The frontend should issue a warning for this case, so this is a sanity
- // check.
+ // The frontend should issue a warning for this case. Just return.
return;
} else if (CE->getNumArgs() == MaxArgCount) {
const Expr *Arg = CE->getArg(CreateModeArgIndex);
@@ -366,7 +365,7 @@ void UnixAPIPortabilityChecker::BasicAllocationCheck(CheckerContext &C,
const unsigned numArgs,
const unsigned sizeArg,
const char *fn) const {
- // Sanity check for the correct number of arguments
+ // Check for the correct number of arguments.
if (CE->getNumArgs() != numArgs)
return;