[cfe-dev] clang and Crypto++

Chris Lattner clattner at apple.com
Wed Jan 5 10:06:24 PST 2011


On Jan 5, 2011, at 9:45 AM, Marshall Clow wrote:

>> Naturally, we'd like to know where in clang this time is going. Is it the front end (-fsyntax-only)? The optimizer (> -O0), and if so, which one(s)?
> 
> Looks like the optimizer.
> 
> $ time clang++ -Wno-tautological-compare -DNDEBUG -g         -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -fsyntax-only sha.cpp 
> real	6.234s
> $ time clang++ -Wno-tautological-compare -DNDEBUG -g         -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
> real 7.863s
> $ time clang++ -Wno-tautological-compare -DNDEBUG -g -O1 -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
> real 17.882s
> $ time clang++ -Wno-tautological-compare -DNDEBUG -g -O2 -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
> .... long, long time; I killed it after 30 minutes.
> 
> How do I tell which one?

Try passing -ftime-report to clang.  Another silly question: did you build clang itself in debug mode?  The first few lines of:

$ clang -cc1 -version

Should show either:

Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.9svn
  DEBUG build with assertions.

or:

Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.9svn
  Optimized build.

-Chris



More information about the cfe-dev mailing list