On Fri, Nov 9, 2012 at 8:16 PM, Rafael Espíndola <[email protected]> wrote: > 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).
Sounds good. Just out of interest/curiosity, would it be possible/practical/useful to replace your comments with asserts that show that these cases have already been correctly handled? - David _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
