[cfe-commits] [patch] Fix pr13844

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Nov 9 20:16:44 PST 2012


In Sema::MergeVarDecl we already handle merging of storage classes and
visibility attributes, so part of the code in getLVForDecl is
duplicated. The one exception is the very peculiar __private_extern__
where

__private_extern__ int N;
int N;

is not the same as just

int N;

or

__private_extern__ int N;

so we do need to look at more than one decl to decide the linkage.
This patch just removes the unnecessary bits. With this the "clang -c"
time of a Release build in a file with 10k repetitions of

extern int no_such_variable;

goes from 2.724s  seconds to 1.339s seconds. GCC 4.7.2 takes 0.003s,
so there is still room for improvement (working on it).

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 2298 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121109/e3dcadf0/attachment.obj>


More information about the cfe-commits mailing list