[cfe-dev] Constant folding in clang

Sean Silva silvas at purdue.edu
Tue Mar 5 16:38:13 PST 2013

On Tue, Mar 5, 2013 at 2:48 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> Additionally, the mechanism we use to generate IR does some
> constant folding itself.

The exact mechanism that Richard is referring to here is IRBuilder,
which does constant folding by default. You can try to plug in a noop
constant folder (IRBuilder's second template arg) and see if that
avoids the constant folding that you want to avoid (see the typedef of
CGBuilderTy in lib/CodeGen/CGBuilder.h).

-- Sean Silva

More information about the cfe-dev mailing list