[cfe-dev] Cross translational unit LocationContext?

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 10 10:52:02 PST 2018


We don't have the global chain because we don't analyze the program 
starting from main() - we only have a look at individual functions and 
see if there are any defects that we can prove by looking at just those 
functions and their direct or indirect *callees*, without trying to 
guess their *callers*. `LocationContext::dumpStack()` prints all stack 
frames that we see, in all cases, starting from the beginning of the 
current "analysis" (the "analysis" is a single choice of a top-level 
functions, and currently we conduct multiple analysis per translation 
unit until all functions in the translation unit were covered either as 
top-level functions or as callees). Even when the cross-translation-unit 
patch lands, the location context chain would contain the whole stack, 
and we still wouldn't be analyzing the whole program from main(), we'd 
just behave better when those callees are not in the same translation 
unit, but we'd still begin our analysis from pretty much arbitrary 
individual functions.

On 10/01/2018 12:12 AM, themod 1302 via cfe-dev wrote:
> Hello everyone,
>
> In my checker I am analyzing the LocationContext object to get the 
> chain of functions which were called up to the current program point 
> (similar to what LocationContext::dumpStack() does).
> Of course, when analyzing a single source file, the chain contains 
> only local functions.
>
> But is there a way to get the _whole_ (global) chain?
>
> I know there is a patch for cross translational unit analysis 
> (https://reviews.llvm.org/D30691) but I still have't been able to dump 
> the whole stack.
>
> Thanks, Tom
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list