Changeset 6896548 for src/AST/Expr.hpp


Ignore:
Timestamp:
Jun 13, 2019, 3:56:24 PM (3 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
6a1dfda
Parents:
d76f32c
Message:

Fixed convert-convert issues with strings, when conversion happens after resolve. Three specific issues fixed.

  1. String literals were not roundtripping new-old-new with the original type at the constant level, whereas the resolver changes the expression-level type from array to pointer.
  2. String literals were roundtripping with noise on a "--print astexpr" diff, with the char-array's index type coming up signed int (expecting unsigned long long int).
  3. Function calls that pass a foo[] variable as argument to a foo* formal were crashing on copy-constructor generation because convert-convert was changing the arg-expression type from foo* (set by the resolver, as expecteed) back to foo[], taken from the variable (switched to foo* taken from convert-src expression).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    rd76f32c r6896548  
    381381        /// generates a floating point constant of the given double
    382382        static ConstantExpr * from_double( const CodeLocation & loc, double d );
    383         /// generates an array of chars constant of the given string
    384         static ConstantExpr * from_string( const CodeLocation & loc, const std::string & s );
    385383        /// generates a null pointer value for the given type. void * if omitted.
    386384        static ConstantExpr * null( const CodeLocation & loc, const Type * ptrType = nullptr );
Note: See TracChangeset for help on using the changeset viewer.