Clang default compiler options


I am trying to add compiler default setting in Clang so that I dont have to pass them on command line.

For example:

Instead of calling

clang -O3

I just want to call clang in command line which has by default -O3 flag passed to it.

Any clues on how this can be done?



Check file lib/CodeGen/BackendUtil.cpp.

You can see that options are being set based on CodeGenOpts.

Why don’t you use an alias or a script?