[<<][meta][>>][..]
Mon Jan 2 10:06:32 EST 2012

Some missing Unatom

Trying to compile t16' I get this:

  struct tuple_f00f00 {
      struct {
          float m0;
      } m0;
      struct {
          float m0;
      } m1;
  };

  const struct tuple_f00f00 t13 = a0[t12];
  const float s14 = t13.m0;  // incorrect

This should be

  const float s14 = t13.m0.m0;

Probably a missing Atom / Unatom.  PrettyC.hs seems to be correct
since it generates proper dereferencing for the other cases.  Code.hs?

Can't find it from code inspection.  I need a proper Term
prettyprinter.  It's 'pp' in the tests.  Just a bit verbose.  The
relevant part of the Term struct is:

            const float s14 = t13.m0;
            const float s15 = t13.m1;

                    Unpack (
                      VarCons (
                        VarAtom
                          Var
                            { varType = Type
                                          AFloat
                                          0
                            , varName = "s14"
                            } ) (
                        VarAtom
                          Var
                            { varType = Type
                                          AFloat
                                          0
                            , varName = "s15"
                            } ) ) (
                      Ref
                        Var
                          { varType = Type (
                                        ATree (
                                          ACons (
                                            Type (
                                              ATree (
                                                AAtom (
                                                  Type
                                                    AFloat
                                                    0 ) ) )
                                              0 ) (
                                            Type (
                                              ATree (
                                                AAtom (
                                                  Type
                                                    AFloat
                                                    0 ) ) )
                                              0 ) ) )
                                        0
                          , varName = "t13"
                          } ) (  ... )

Inspecting Unpack points at termList / varList.

Ok, this is hidden somewhere in a recursion in cStructVarInit.  It's
probably simplest to transform a variable type to a structured
initializer (Cdr (Car ...)) and reuse the other Unpack case.




[Reply][About]
[<<][meta][>>][..]