<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>We have a Clang Static Analyzer plugin that exposes several custom checkers. Currently I'm working on a checker that aims to enforce the practice that it is the responsibility of the class ctors to initialize all member variables.<br></div>
<div> </div>
<div>Unfortunately, this requires the Static Analyzer to analyze the constructor, which does not happen without having the ctor called from a global function, which the SA treats as entry points.<br></div>
<div>This, however, leads to a problem: in production code, the definition of the class members and the user of the class are usually in different TUs, i.e. the SA won't be able to analyze the ctor call.<br></div>
<div> </div>
<div>Therefore, I'd like to make the SA treat constructors as entry points. More generally, how can I control which functions are analyzed (i.e. treated as entry points)? If this is not really something that can be done externally (i.e. outside Clang itself), where should I look inside the Clang source for this logic? (We can then create a patch, and ship a custom-patched version of Clang alongside with our checker library.)<br></div>
<div> </div>
<div>Thanks!<br></div>
<div> </div>
<div id="sig19426269"><div class="signature">-- <br></div>
<div class="signature">  Gábor 'ShdNx' Kozár<br></div>
<div class="signature">  kozargabor@gmail.com<br></div>
<div class="signature"> </div>
</div>
</body>
</html>