This is an archive of the discontinued LLVM Phabricator instance.

Debloat some headers
AbandonedPublic

Authored by ariccio on Feb 10 2016, 11:24 PM.

Details

Summary

As discussed in "Code in headers" on llvm-dev, there are lots of headers with complex code in them. I've moved some complex constructors & destructors to implementation files, using Chromium's C++ Dos and Don'ts as a guide.

These changes are mostly in the Static Analyzer, as some files there take more than 30 seconds to compile.

On the mailing list, Chris Lattner said that we should measure how this affects the performance of the compiler generated by this code. Any idea how we do that?

Eh, Imma drop this patch. It turns out that there's not enough of an improvement here to justify the effort.

Diff Detail

Event Timeline

ariccio updated this revision to Diff 47601.Feb 10 2016, 11:24 PM
ariccio retitled this revision from to Debloat some headers.
ariccio updated this object.
ariccio added a subscriber: cfe-commits.

What's complex about the SVal constructors?

llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
143

I think previous discussions on the mail list have talked about only using emplace_back if the type isn't trivially copyable/moveable.

ariccio updated this revision to Diff 47603.Feb 11 2016, 12:41 AM
ariccio updated this object.
ariccio added inline comments.
llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
143

I did this as a drive by "fix", I thought it was a tad bit simpler than explicitly calling make_pair. I can change it back if you'd like.

What's complex about the SVal constructors?

I arbitrarily figured that classes that are more than twice-derived (is there a better way to say that) are complex. I don't think there was any particularly good reason there.

ariccio updated this object.Feb 11 2016, 6:10 PM
ariccio added a reviewer: dcoughlin.

What the build time of clang before and after? (Your goal is to improve build time right?)

ariccio updated this object.Feb 14 2016, 11:11 PM
ariccio updated this object.
ariccio abandoned this revision.Feb 14 2016, 11:14 PM