mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-05 07:32:36 +00:00
fec1a442e3
This commit introduces a new attribute `called_once`. It can be applied to function-like parameters to signify that this parameter should be called exactly once. This concept is particularly widespread in asynchronous programs. Additionally, this commit introduce a new group of dataflow analysis-based warnings to check this property. It identifies and reports the following situations: * parameter is called twice * parameter is never called * parameter is not called on one of the paths Current implementation can also automatically infer `called_once` attribute for completion handler paramaters that should follow the same principle by convention. This behavior is OFF by default and can be turned on by using `-Wcompletion-handler`. Differential Revision: https://reviews.llvm.org/D92039 rdar://72812043
46 lines
775 B
CMake
46 lines
775 B
CMake
set(LLVM_LINK_COMPONENTS
|
|
FrontendOpenMP
|
|
Support
|
|
)
|
|
|
|
add_clang_library(clangAnalysis
|
|
AnalysisDeclContext.cpp
|
|
BodyFarm.cpp
|
|
CalledOnceCheck.cpp
|
|
CFG.cpp
|
|
CFGReachabilityAnalysis.cpp
|
|
CFGStmtMap.cpp
|
|
CallGraph.cpp
|
|
CloneDetection.cpp
|
|
CocoaConventions.cpp
|
|
ConstructionContext.cpp
|
|
Consumed.cpp
|
|
CodeInjector.cpp
|
|
Dominators.cpp
|
|
ExprMutationAnalyzer.cpp
|
|
IssueHash.cpp
|
|
LiveVariables.cpp
|
|
ObjCNoReturn.cpp
|
|
PathDiagnostic.cpp
|
|
PostOrderCFGView.cpp
|
|
ProgramPoint.cpp
|
|
ReachableCode.cpp
|
|
RetainSummaryManager.cpp
|
|
ThreadSafety.cpp
|
|
ThreadSafetyCommon.cpp
|
|
ThreadSafetyLogical.cpp
|
|
ThreadSafetyTIL.cpp
|
|
UninitializedValues.cpp
|
|
|
|
LINK_LIBS
|
|
clangAST
|
|
clangASTMatchers
|
|
clangBasic
|
|
clangLex
|
|
|
|
DEPENDS
|
|
omp_gen
|
|
)
|
|
|
|
add_subdirectory(plugins)
|