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
t.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
