使用如下命令,统计了一下这三个编译器的代码行数情况。
find . -type f -not -regex '\./\.git.*' | xargs cat | wc -l

结果如下,供参考。这三个编译器使用的都是各个代码库中的最新版本,因为《编译点滴》使用git svn工具,所以命令行里有“git”,而标明的版本号却是SVN的。
Open64(SVN R3782):

open64$ find . -type f -not -regex '\./\.git.*' | xargs cat | wc -l
13164644

LLVM(LLVM R148206, 包含Clang  ):
llvm$ find . -type f -not -regex '\./\.git.*' | xargs cat | wc -l
2468255

GCC(R183190):
gcc$ find . -type f -not -regex '\./\.git.*' | xargs cat | wc -l
12823155

相关文章:

  2 Responses to “Open64、LLVM、GCC源代码行数对比”

  1. is this result right? I do not think gcc has so much code!!!

    • The GCC code comes from GCC SVN trunk. It include gcc testsuit(1674131 lines of code), libstdcxx(1429788 lines of code).
      In my opinion all the files in GCC SVN trunk are all created and useful for GCC. So when calculate lines of code, I include all these files.

      I also use the command mentioned above in the post to calculate the lines of code of the GCC official release 4.6.1 which I downloaded from GCC official mirrors(URL:http://gcc.petsads.us/releases/gcc-4.6.1/gcc-4.6.1.tar.bz2) . And the lines of code is : 12419147(This result also contains testsuite, libstdc++, etc).

      So maybe we have different understanding about what is the GCC source code :)

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
2009-2011© 编译点滴 Suffusion theme by Sayontan Sinha

无觅相关文章插件,快速提升流量