Google C++ needs for Clang

bearophile bearophileHUGS at lycos.com
Mon May 23 15:38:08 PDT 2011


A new nice post in the LLVM blog, about Clang improvements driven by Google C++ programming needs:

http://blog.llvm.org/2011/05/c-at-google-here-be-dragons.html

http://www.reddit.com/r/programming/comments/hibd6/google_extending_clang_c_to_emit_better_more/

Quotations from the blog post:

This is the first time I read something like this about trying to improve programmers productivity:

>As a performance junky, I like to think of this in familiar terms. It’s analogous to an algorithmic performance improvement. You get “algorithmic” improvements in productivity when you reduce the total work required for an engineer to get the job done, or fundamentally shift the time scale that the work requires. However, improving the time a single task requires often runs afoul of all the adages about performance tuning, 80/20 rules, and the pitfalls of over-optimizing.<

Later it says:

long kMaxDiskSpace = 10 << 30;  // Thirty gigs ought to be enough for anybody.
...
Which now trigger the following errors:

example2.cc:12:25: error: shift result (10737418240) requires 35 bits to represent, but 'int' only has 32 bits [-Werror,-Wshift-overflow]
long kMaxDiskSpace = 10 << 30;
                     ~~ ^  ~~

D/DMD is not modern/intelligent/good enough to catch this common error yet, this gives no errors nor warnings in D2:


int kMaxDiskSpace = 10 << 30;
void main() {}


I hope to see D lose its rusted chains and improve on this :-)

Bye,
bearophile


More information about the Digitalmars-d mailing list