[PATCH] D13731: [RFC][Analyzer] Supporting function attributes in .model files.
pierre gousseau via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 14 10:22:42 PDT 2015
pgousseau created this revision.
pgousseau added a subscriber: cfe-commits.
Dear All,
I would like to propose a patch for specifying function attributes in .model files to be used by the analyzer checkers.
There are a number of checkers (such as UncheckedReturn) that contain hardcoded list of functions, I would like to make these checkers available to a wider number of functions by tagging the function definition with appropriate attribute information. I have a situation where we cannot append the function attributes to library header files; instead I propose a patch that allows us to publish attribute information via .model files. The patch modifies the .model file parser to allow for the extraction of function declarations found in the .model file. The UncheckedReturn checker is modified to handle the 'warn_unused_result' attribute. Attributes obtained from non-model files are still available to the analyzer, and the interface does not try to hide the origin of the attribute.
Please can you review this for submission
Regards,
Pierre Gousseau
SN-Systems - Sony Computer Entertainment
http://reviews.llvm.org/D13731
Files:
include/clang/Analysis/AnalysisContext.h
include/clang/Analysis/CodeInjector.h
include/clang/StaticAnalyzer/Frontend/FrontendActions.h
include/clang/StaticAnalyzer/Frontend/ModelConsumer.h
lib/Analysis/AnalysisDeclContext.cpp
lib/Analysis/BodyFarm.cpp
lib/Analysis/BodyFarm.h
lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
lib/StaticAnalyzer/Frontend/FrontendActions.cpp
lib/StaticAnalyzer/Frontend/ModelConsumer.cpp
lib/StaticAnalyzer/Frontend/ModelInjector.cpp
lib/StaticAnalyzer/Frontend/ModelInjector.h
test/Analysis/Inputs/Models/returnNeedsCheckHasModelFile.model
test/Analysis/unchecked-return.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13731.37362.patch
Type: text/x-patch
Size: 13502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151014/dab6b6ea/attachment-0001.bin>
More information about the cfe-commits
mailing list