[LLVMdev] Optimization of string.h calls

Iritscen iritscen at yahoo.com
Fri Sep 19 08:49:17 PDT 2014


Hello all.  Is there a way to get llvm/clang at build-time to optimize a string.h call so that the final form of the string is saved in the binary?  For instance, for a statement like...

strrchr(__FILE__, '/') + 1

…and where clang is called on this code’s source file with “clang /some/long/path/file.c”, can I end up with only “file.c” stored in the binary on disk?  I think you can see that I am attempting to avoid full paths from my machine ending up in the program.  My IDE, Xcode, always passes full paths to clang when building.  Thanks.



More information about the llvm-dev mailing list