On 12/19/2014 03:46 PM, Michael Collison wrote:
The reason I included tree-core.h in all the .c files was the requirement in tree.h (now flattened to the .c files) for fold-const.h. In tree.h there are inline functions such as fold_build_pointer_plus_hwi_loc which reference functions in fold-const.h. The moment you include fold-const.h you require the 'enum tree_code' definition from tree-core.h for fold-const.h.

How would you suggest I get around this?

Its only the 3 functions right?
convert_to_ptrofftype_loc(), fold_build_pointer_plus_loc(), and fold_build_pointer_plus_hwi_loc() ?

And its just because they are lnlines.

The direct approach is to move them to tree.c, then exported via tree.h... When I look at what they do and where they are called from, the better solution might be to move the functions to fold-const.c, and export from fold-const.h. All they are doing are acting as wrappers and calling a fold_* routine... They are also called from within fold-const.c as well... Seems like maybe they belong there. (And move the accompanying #defines that don't require the _loc extention to fold_const.h.)

This will also break the annoying dependency of tree.h needing fold-const.h to compile...

Andrew

Reply via email to