[LLVMdev] [RFC] Removing static initializers for command line options

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Aug 19 11:27:22 PDT 2014


> This is a good point. I see two sensible options:
>
> 1) don't add anything to the C API unless someone specifically asks, as Rafael suggests.
>
> 2) make options passed to passes use some kind of loose coupling, like an array of strings or even better an options object where the user sets key/value pairs by some call (eg. LLVMSetOption(optionObject, keyString, valueString).
>
> The upside of (2) is that it preserves current functionality and new options can be added easily. The downside is that we'd have to get very particular about whether an option needs to be supported indefinitely if it is ever exposed. Probably nobody wants that strong of a contract.

This depends on what we mean by "ABI". Do me mean "it links"? If so,
yes, something like  LLVMConfigSetBoolValue(Config,
"ScalarizeLoadStore", 1) is not part of the C abi. We could remove or
rename the ScalarizeLoadStore option.

But in my opinion that is a bit too narrow a definition. What we
really should care about is "WebKit still works with the next llvm".
The same is true for other users, and if one of those users depends on
an option, having that option be symbol, a constructor argument or or
a well know string seems like an implementation detail.

Cheers,
Rafael




More information about the llvm-dev mailing list