[cfe-dev] Clang types and LLVM types

Eli Friedman eli.friedman at gmail.com
Sat May 1 05:24:44 PDT 2010


On Sat, May 1, 2010 at 3:30 AM, Sebastian Redl
<sebastian.redl at getdesigned.at> wrote:
> Hi,
>
> I'm hunting a miscompilation in Boost.PropertyTree, and there's
> something in the generated bitcode that I find suspect. Namely, I have
> this function in the source:
>
>    template<class Ptree>
>    void read_json_internal(std::basic_istream<typename
> Ptree::key_type::value_type> &stream,
>                            Ptree &pt,
>                            const std::string &filename)
>
> And in the bitcode, it becomes:
>
> define linkonce_odr void
> @_ZN5boost13property_tree11json_parser18read_json_internalINS0_11basic_ptreeISsSsSt4lessISsEEEEEvRSt13basic_istreamINT_8key_type10value_typeESt11char_traitsIS9_EERS8_RKSs(%"class.std::basic_istream"*
> %stream, %"class.boost::property_tree::basic_ptree"* %pt,
> %"class.boost::spirit::classic::parser_id"* %filename) {
>
> Note the 'filename' argument, whose type has changed to parser_id. Is
> this a natural consequence of structural type matching, or is this
> actually something to be worried about?

Looks like just structural type matching; when multiple structs have
the same LLVM type, the name used is chosen arbitrarily.

-Eli




More information about the cfe-dev mailing list