[PATCH] D25363: [Sema] Store a SourceRange for multi-token builtin types

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 11:16:12 PDT 2016


aaron.ballman added inline comments.


================
Comment at: include/clang/AST/TypeLoc.h:513
 struct BuiltinLocInfo {
-  SourceLocation BuiltinLoc;
+  SourceRange BuiltinRange;
 };
----------------
malcolm.parsons wrote:
> aaron.ballman wrote:
> > malcolm.parsons wrote:
> > > aaron.ballman wrote:
> > > > Since this doubles the size of the type loc for builtin types, do you happen to have any data on what practical impact this has on RAM usage, say for bootstrapping LLVM (or compiling any large source base, really)? Hopefully it's not a lot, but it would be nice to know if it's a .1%, 1%, 10%, etc increase in usage (or does the change get lost in the noise).
> > > I don't have any data.
> > > I'm not sure how to collect that data.
> > It's likely platform dependent, but I was thinking something as simple as looking at peak RAM usage between two different builds of the compiler. Something like `top` would probably work if you're on Linux (unless someone knows of a better way, I'm not strong on Linux).
> Before:
> /usr/bin/time clang++ ... -c llvm/tools/clang/lib/AST/ExprConstant.cpp
> 5.56user 0.13system 0:05.91elapsed 96%CPU (0avgtext+0avgdata 256820maxresident)k
> 
> After:
> /usr/bin/time clang++ ... -c llvm/tools/clang/lib/AST/ExprConstant.cpp
> 5.67user 0.12system 0:05.98elapsed 97%CPU (0avgtext+0avgdata 256940maxresident)k
> 
> ((256940 - 256820) / 256820) * 100 = 0.05%
Thank you for this -- is there a bigger delta for compilation of LLVM as a whole? ExprConstant.cpp is an interesting case, but not really representative of the project as a whole (for instance, there's not a lot of template metaprogramming in ExprConstant.cpp).


https://reviews.llvm.org/D25363





More information about the cfe-commits mailing list