[clang] 7984189 - [analyzer] Remove HasAlphaDocumentation tablegen enum value
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 19 03:14:56 PDT 2022
Author: Balazs Benics
Date: 2022-04-19T12:14:27+02:00
New Revision: 798418982630b5e3acdfc7ba398993aef2071f32
URL: https://github.com/llvm/llvm-project/commit/798418982630b5e3acdfc7ba398993aef2071f32
DIFF: https://github.com/llvm/llvm-project/commit/798418982630b5e3acdfc7ba398993aef2071f32.diff
LOG: [analyzer] Remove HasAlphaDocumentation tablegen enum value
D121387 simplified the doc url generation process, so we no longer need
the HasAlphaDocumentation enum entry. This patch removes that.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D121459
Added:
Modified:
clang/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
Removed:
################################################################################
diff --git a/clang/include/clang/StaticAnalyzer/Checkers/CheckerBase.td b/clang/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
index 98d26aaa637d1..bc1da9bb3f904 100644
--- a/clang/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
+++ b/clang/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
@@ -86,15 +86,14 @@ class ParentPackage<Package P> { Package ParentPackage = P; }
class HelpText<string text> { string HelpText = text; }
/// Describes what kind of documentation exists for the checker.
-class DocumentationEnum<bits<2> val> {
- bits<2> Documentation = val;
+class DocumentationEnum<bits<1> val> {
+ bits<1> Documentation = val;
}
def NotDocumented : DocumentationEnum<0>;
def HasDocumentation : DocumentationEnum<1>;
-def HasAlphaDocumentation : DocumentationEnum<2>;
class Documentation<DocumentationEnum val> {
- bits<2> Documentation = val.Documentation;
+ bits<1> Documentation = val.Documentation;
}
/// Describes a checker. Every builtin checker has to be registered with the use
@@ -114,7 +113,7 @@ class Checker<string name = ""> {
list<Checker> Dependencies;
// This field is optional.
list<Checker> WeakDependencies;
- bits<2> Documentation;
+ bits<1> Documentation;
Package ParentPackage;
bit Hidden = 0;
}
diff --git a/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td b/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
index 9340a114ac456..b5ce1eda200c7 100644
--- a/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
+++ b/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
@@ -236,57 +236,57 @@ let ParentPackage = CoreAlpha in {
def BoolAssignmentChecker : Checker<"BoolAssignment">,
HelpText<"Warn about assigning non-{0,1} values to Boolean variables">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def CastSizeChecker : Checker<"CastSize">,
HelpText<"Check when casting a malloc'ed type T, whether the size is a "
"multiple of the size of T">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def CastToStructChecker : Checker<"CastToStruct">,
HelpText<"Check for cast from non-struct pointer to struct pointer">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def ConversionChecker : Checker<"Conversion">,
HelpText<"Loss of sign/precision in implicit conversions">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def IdenticalExprChecker : Checker<"IdenticalExpr">,
HelpText<"Warn about unintended use of identical expressions in operators">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def FixedAddressChecker : Checker<"FixedAddr">,
HelpText<"Check for assignment of a fixed address to a pointer">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def PointerArithChecker : Checker<"PointerArithm">,
HelpText<"Check for pointer arithmetic on locations other than array "
"elements">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def PointerSubChecker : Checker<"PointerSub">,
HelpText<"Check for pointer subtractions on two pointers pointing to "
"
diff erent memory chunks">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def SizeofPointerChecker : Checker<"SizeofPtr">,
HelpText<"Warn about unintended use of sizeof() on pointer expressions">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def TestAfterDivZeroChecker : Checker<"TestAfterDivZero">,
HelpText<"Check for division by variable that is later compared against 0. "
"Either the comparison is useless or there is division by zero.">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def DynamicTypeChecker : Checker<"DynamicTypeChecker">,
HelpText<"Check for cases where the dynamic and the static type of an object "
"are unrelated.">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def StackAddrAsyncEscapeChecker : Checker<"StackAddressAsyncEscape">,
HelpText<"Check that addresses to stack memory do not escape the function">,
Dependencies<[StackAddrEscapeBase]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def PthreadLockBase : Checker<"PthreadLockBase">,
HelpText<"Helper registering multiple checks.">,
@@ -296,7 +296,7 @@ def PthreadLockBase : Checker<"PthreadLockBase">,
def C11LockChecker : Checker<"C11Lock">,
HelpText<"Simple lock -> unlock checker">,
Dependencies<[PthreadLockBase]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "alpha.core"
@@ -464,22 +464,22 @@ let ParentPackage = CStringAlpha in {
def CStringOutOfBounds : Checker<"OutOfBounds">,
HelpText<"Check for out-of-bounds access in string functions">,
Dependencies<[CStringModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def CStringBufferOverlap : Checker<"BufferOverlap">,
HelpText<"Checks for overlap in two buffer arguments">,
Dependencies<[CStringModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def CStringNotNullTerm : Checker<"NotNullTerminated">,
HelpText<"Check for arguments which are not null-terminating strings">,
Dependencies<[CStringModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def CStringUninitializedRead : Checker<"UninitializedRead">,
HelpText<"Checks if the string manipulation function would read uninitialized bytes">,
Dependencies<[CStringModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "alpha.unix.cstring"
@@ -541,24 +541,24 @@ let ParentPackage = UnixAlpha in {
def ChrootChecker : Checker<"Chroot">,
HelpText<"Check improper use of chroot">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def PthreadLockChecker : Checker<"PthreadLock">,
HelpText<"Simple lock -> unlock checker">,
Dependencies<[PthreadLockBase]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def StreamChecker : Checker<"Stream">,
HelpText<"Check stream handling functions">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def SimpleStreamChecker : Checker<"SimpleStream">,
HelpText<"Check for misuses of stream APIs">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def BlockInCriticalSectionChecker : Checker<"BlockInCriticalSection">,
HelpText<"Check for calls to blocking functions inside a critical section">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def StdCLibraryFunctionArgsChecker : Checker<"StdCLibraryFunctionArgs">,
HelpText<"Check constraints of arguments of C standard library functions, "
@@ -566,7 +566,7 @@ def StdCLibraryFunctionArgsChecker : Checker<"StdCLibraryFunctionArgs">,
"or is EOF.">,
Dependencies<[StdCLibraryFunctionsChecker]>,
WeakDependencies<[CallAndMessageChecker, NonNullParamChecker, StreamChecker]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "alpha.unix"
@@ -701,7 +701,7 @@ def UninitializedObjectChecker: Checker<"UninitializedObject">,
"false",
InAlpha>
]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def VirtualCallChecker : Checker<"VirtualCall">,
HelpText<"Check virtual function calls during construction/destruction">,
@@ -734,11 +734,11 @@ def ContainerModeling : Checker<"ContainerModeling">,
def DeleteWithNonVirtualDtorChecker : Checker<"DeleteWithNonVirtualDtor">,
HelpText<"Reports destructions of polymorphic objects with a non-virtual "
"destructor in their base class">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def EnumCastOutOfRangeChecker : Checker<"EnumCastOutOfRange">,
HelpText<"Check integer to enumeration casts for out of range values">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def IteratorModeling : Checker<"IteratorModeling">,
HelpText<"Models iterators of C++ containers">,
@@ -762,23 +762,23 @@ def STLAlgorithmModeling : Checker<"STLAlgorithmModeling">,
def InvalidatedIteratorChecker : Checker<"InvalidatedIterator">,
HelpText<"Check for use of invalidated iterators">,
Dependencies<[IteratorModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def IteratorRangeChecker : Checker<"IteratorRange">,
HelpText<"Check for iterators used outside their valid ranges">,
Dependencies<[IteratorModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def MismatchedIteratorChecker : Checker<"MismatchedIterator">,
HelpText<"Check for use of iterators of
diff erent containers where iterators "
"of the same container are expected">,
Dependencies<[IteratorModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def SmartPtrChecker: Checker<"SmartPtr">,
HelpText<"Find the dereference of null SmrtPtr">,
Dependencies<[SmartPtrModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end: "alpha.cplusplus"
@@ -841,7 +841,7 @@ let ParentPackage = DeadCodeAlpha in {
def UnreachableCodeChecker : Checker<"UnreachableCode">,
HelpText<"Check unreachable code">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "alpha.deadcode"
@@ -978,19 +978,19 @@ let ParentPackage = SecurityAlpha in {
def ArrayBoundChecker : Checker<"ArrayBound">,
HelpText<"Warn about buffer overflows (older checker)">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">,
HelpText<"Warn about buffer overflows (newer checker)">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def ReturnPointerRangeChecker : Checker<"ReturnPtrRange">,
HelpText<"Check for an out-of-bound pointer being returned to callers">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def MallocOverflowSecurityChecker : Checker<"MallocOverflow">,
HelpText<"Check for overflows in the arguments to malloc()">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def MmapWriteExecChecker : Checker<"MmapWriteExec">,
HelpText<"Warn on mmap() calls that are both writable and executable">,
@@ -1006,7 +1006,7 @@ def MmapWriteExecChecker : Checker<"MmapWriteExec">,
"0x01",
Released>
]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "alpha.security"
@@ -1025,7 +1025,7 @@ def GenericTaintChecker : Checker<"TaintPropagation">,
"",
InAlpha>,
]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "alpha.security.taint"
@@ -1216,13 +1216,13 @@ def InstanceVariableInvalidation : Checker<"InstanceVariableInvalidation">,
HelpText<"Check that the invalidatable instance variables are invalidated in "
"the methods annotated with objc_instance_variable_invalidator">,
Dependencies<[IvarInvalidationModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def MissingInvalidationMethod : Checker<"MissingInvalidationMethod">,
HelpText<"Check that the invalidation methods are present in classes that "
"contain invalidatable instance variables">,
Dependencies<[IvarInvalidationModeling]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
def DirectIvarAssignment : Checker<"DirectIvarAssignment">,
HelpText<"Check for direct assignments to instance variables">,
@@ -1235,7 +1235,7 @@ def DirectIvarAssignment : Checker<"DirectIvarAssignment">,
"false",
InAlpha>
]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "alpha.osx.cocoa"
@@ -1301,7 +1301,7 @@ let ParentPackage = LocalizabilityAlpha in {
def PluralMisuseChecker : Checker<"PluralMisuseChecker">,
HelpText<"Warns against using one vs. many plural pattern in code when "
"generating localized strings.">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "alpha.osx.cocoa.localizability"
@@ -1321,7 +1321,7 @@ let ParentPackage = LLVMAlpha in {
def LLVMConventionsChecker : Checker<"Conventions">,
HelpText<"Check code for LLVM codebase conventions">,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "llvm"
@@ -1631,7 +1631,7 @@ def CloneChecker : Checker<"CloneChecker">,
"\"\"",
Released>
]>,
- Documentation<HasAlphaDocumentation>;
+ Documentation<HasDocumentation>;
} // end "clone"
More information about the cfe-commits
mailing list