Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing`…

Authored by anton-afanasyev on Mar 30 2019, 1:42 AM.


Adds -ftime-trace option to clang that produces Chrome chrome://tracing compatible JSON profiling output dumps.

This change adds hierarchical "time trace" profiling blocks that can be visualized in Chrome, in a "flame chart" style. Each profiling block can have a "detail" string that for example indicates the file being processed, template name being instantiated, function being optimized etc.

This is taken from GitHub PR: https://github.com/aras-p/llvm-project-20170507/pull/2

Patch by Aras Pranckevičius.

Differential Revision: https://reviews.llvm.org/D58675

llvm-svn: 357340