]> granicus.if.org Git - clang/commit
Move the Preprocessor::Diag methods inline. This has the interesting
authorChris Lattner <sabre@nondot.org>
Sat, 22 Nov 2008 07:03:46 +0000 (07:03 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 22 Nov 2008 07:03:46 +0000 (07:03 +0000)
commitadc4eeb08042a35ae914fc557ffec0cef3df2374
treee2396f14e8c77a33e4eb655d3bacb01aad732c4e
parentcd761cd1a73510f4577fa00d9a6ce15090a0a135
Move the Preprocessor::Diag methods inline.  This has the interesting
(and carefully calculated) effect of allowing the compiler to reason
about the aliasing properties of DiagnosticBuilder object better,
allowing the whole thing to be promoted to registers instead of
resulting in a ton of stack traffic.

While I'm not very concerned about the performance of the Diag() method
invocations, I *am* more concerned about their code size and impact on the
non-diagnostic code.  This patch shrinks the clang executable (in
release-asserts mode with gcc-4.2) from 14523980 to 14519816 bytes.  This
isn't much, but it shrinks the lexer from 38192 to 37776, PPDirectives.o
from 31116 to 28868 bytes, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59862 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Lex/Preprocessor.h
lib/Lex/Preprocessor.cpp