[cfe-dev] What makes Clang non-deterministic?

Mikael Persson mikael.s.persson at gmail.com
Thu Jan 1 08:44:22 PST 2015


Hi,

I've been chasing some bugs in templight (template instantiation profiler)
by generating traces for some template-heavy code, and in the process, I've
been printing out some debug information including the total number of
template instantiations that clang does when compiling the source code.
>From multiple runs in succession (with same clang binary and same source
file), there is always a small fluctuation in the number of instantiations
done, by roughly 1% - 2% (for example, one of my source files yields total
instantiation counts that fluctuate between 203,000 and 208,000).

So, Clang is non-deterministic (at least, at semantic analysis). I'm just
curious as to why that is? Is it some special technique being used? Or is
it the consequence of some UB bugs?

Cheers,
Mikael.

-- 
Sven Mikael Persson, M.Sc.(Tech.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150101/58cbe563/attachment.html>


More information about the cfe-dev mailing list