Pass llvm options to DragonEgg

Hello All,

Another newbie question. I am confused as to what options will work
with "fplugin-arg-dragonegg-llvm-option" for dragonegg plugin. Readme
says it is used to pass command-line options to llvm. I shall
consolidate into 3 questions. For all examples below, I used combo-
gcc 4.6 + dragonegg(trunk) + llvm(trunk)

(1). Does 'fplugin-arg-dragonegg-llvm-option' allow all 'opt' options?

$ gcc -fplugin=dragonegg.so
-fplugin-arg-dragonegg-llvm-option='-disable-inlining' foo.c -S
cc1: Unknown command line argument '-disable-inlining'. Try: 'cc1 -help'

(2). Does 'fplugin-arg-dragonegg-llvm-option' allow ONLY 'opt'
options? (by llvm options does it mean only opt)

(3). Depending on answer to (2), currently is there a way to pass llc
options to dragonegg? For instance -menable-unsafe-math?

$ gcc -fplugin=dragonegg.so
-fplugin-arg-dragonegg-llvm-option='-menable-unsafe-math' foo.c -S
cc1: Unknown command line argument '-menable-unsafe-math'. Try: 'cc1 -help'

The case for passing 'llc' options stems from the requirement that
code generation is controlled by many llc options(math for example).
Please correct if the options are wrong.

- Anitha

Hello All,

Another newbie question. I am confused as to what options will work
with "fplugin-arg-dragonegg-llvm-option" for dragonegg plugin. Readme
says it is used to pass command-line options to llvm. I shall
consolidate into 3 questions. For all examples below, I used combo-
gcc 4.6 + dragonegg(trunk) + llvm(trunk)

(1). Does 'fplugin-arg-dragonegg-llvm-option' allow all 'opt' options?

$ gcc -fplugin=dragonegg.so
-fplugin-arg-dragonegg-llvm-option='-disable-inlining' foo.c -S
cc1: Unknown command line argument '-disable-inlining'. Try: 'cc1 -help'

(2). Does 'fplugin-arg-dragonegg-llvm-option' allow ONLY 'opt'
options? (by llvm options does it mean only opt)

(3). Depending on answer to (2), currently is there a way to pass llc
options to dragonegg? For instance -menable-unsafe-math?

$ gcc -fplugin=dragonegg.so
-fplugin-arg-dragonegg-llvm-option='-menable-unsafe-math' foo.c -S
cc1: Unknown command line argument '-menable-unsafe-math'. Try: 'cc1 -help'

The case for passing 'llc' options stems from the requirement that
code generation is controlled by many llc options(math for example).
Please correct if the options are wrong.

Guess, no help? I am left to debug on my own :frowning:
A quick looks shows that dragonegg passes pseudo args to
llvm::cl::ParseCommandLineOptions. After this, it is left to the
commandline parser to crib. Probably the optionsMap is not initialized
properly ..?