Skip to content

Commit aaf67cb

Browse files
haoNoQmemfrob
authored andcommitted
[analyzer] Move apiModeling.StdCLibraryFunctionArgs to alpha.
It was enabled by default accidentally; still missing some important features. Also it needs a better package because it doesn't boil down to API modeling. Differential Revision: https://reviews.llvm.org/D80213
1 parent 1908e2e commit aaf67cb

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

clang/include/clang/StaticAnalyzer/Checkers/Checkers.td

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ def LLVMAlpha : Package<"llvm">, ParentPackage<Alpha>;
102102
// any diagnostics. These checkers are always turned on; this package is
103103
// intended for API modeling that is not controlled by the target triple.
104104
def APIModeling : Package<"apiModeling">, Hidden;
105+
def APIModelingAlpha : Package<"apiModeling">, ParentPackage<Alpha>, Hidden;
106+
105107
def GoogleAPIModeling : Package<"google">, ParentPackage<APIModeling>, Hidden;
106108
def LLVMAPIModeling : Package<"llvm">, ParentPackage<APIModeling>, Hidden;
107109

@@ -304,19 +306,23 @@ def StdCLibraryFunctionsChecker : Checker<"StdCLibraryFunctions">,
304306
]>,
305307
Documentation<NotDocumented>;
306308

309+
def TrustNonnullChecker : Checker<"TrustNonnull">,
310+
HelpText<"Trust that returns from framework methods annotated with _Nonnull "
311+
"are not null">,
312+
Documentation<NotDocumented>;
313+
314+
} // end "apiModeling"
315+
316+
let ParentPackage = APIModelingAlpha in {
317+
307318
def StdCLibraryFunctionArgsChecker : Checker<"StdCLibraryFunctionArgs">,
308319
HelpText<"Check constraints of arguments of C standard library functions, "
309320
"such as whether the parameter of isalpha is in the range [0, 255] "
310321
"or is EOF.">,
311322
Dependencies<[StdCLibraryFunctionsChecker]>,
312323
Documentation<NotDocumented>;
313324

314-
def TrustNonnullChecker : Checker<"TrustNonnull">,
315-
HelpText<"Trust that returns from framework methods annotated with _Nonnull "
316-
"are not null">,
317-
Documentation<NotDocumented>;
318-
319-
} // end "apiModeling"
325+
} // end "alpha.apiModeling"
320326

321327
//===----------------------------------------------------------------------===//
322328
// Evaluate "builtin" functions.

clang/test/Analysis/analyzer-enabled-checkers.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// CHECK-NEXT: core.NonNullParamChecker
1010
// CHECK-NEXT: core.CallAndMessage
1111
// CHECK-NEXT: apiModeling.StdCLibraryFunctions
12-
// CHECK-NEXT: apiModeling.StdCLibraryFunctionArgs
1312
// CHECK-NEXT: apiModeling.TrustNonnull
1413
// CHECK-NEXT: apiModeling.llvm.CastValue
1514
// CHECK-NEXT: apiModeling.llvm.ReturnValue

clang/test/Analysis/std-c-library-functions-arg-constraints.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %clang_analyze_cc1 %s \
33
// RUN: -analyzer-checker=core \
44
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctions \
5-
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctionArgs \
5+
// RUN: -analyzer-checker=alpha.apiModeling.StdCLibraryFunctionArgs \
66
// RUN: -analyzer-checker=debug.StdCLibraryFunctionsTester \
77
// RUN: -analyzer-checker=debug.ExprInspection \
88
// RUN: -triple x86_64-unknown-linux-gnu \
@@ -12,7 +12,7 @@
1212
// RUN: %clang_analyze_cc1 %s \
1313
// RUN: -analyzer-checker=core \
1414
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctions \
15-
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctionArgs \
15+
// RUN: -analyzer-checker=alpha.apiModeling.StdCLibraryFunctionArgs \
1616
// RUN: -analyzer-checker=debug.StdCLibraryFunctionsTester \
1717
// RUN: -analyzer-checker=debug.ExprInspection \
1818
// RUN: -triple x86_64-unknown-linux-gnu \

clang/test/Analysis/std-c-library-functions-arg-constraints.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clang_analyze_cc1 %s \
22
// RUN: -analyzer-checker=core \
33
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctions \
4-
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctionArgs \
4+
// RUN: -analyzer-checker=alpha.apiModeling.StdCLibraryFunctionArgs \
55
// RUN: -analyzer-checker=debug.StdCLibraryFunctionsTester \
66
// RUN: -analyzer-checker=debug.ExprInspection \
77
// RUN: -analyzer-config eagerly-assume=false \

0 commit comments

Comments
 (0)