/* PromotableTypeCheck.h */

#ifndef Included_PromotableTypeCheck_h
#define Included_PromotableTypeCheck_h

/* PromotableTypeCheck module depends on */
/* MiscInfo.h */
/* Audit.h */
/* Debug.h */
/* Definitions.h */
/* PcodeObject */
/* CompilerRoot */
/* Memory */
/* ASTUnaryOperator */
/* ASTExpression */

#include "PcodeObject.h"
#include "CompilerRoot.h"

/* all memory allocated in this module is through TrashTracker */

/* forwards */
struct TrashTrackRec;
struct ASTExpressionRec;

/* this routine sees if the right hand type can be promoted (if necessary) to */
/* become the left hand type.  True is returned if that is the case. */
MyBoolean				CanRightBeMadeToMatchLeft(DataTypes LeftType, DataTypes RightType);

/* this routine sees if the right hand type MUST be promoted to become */
/* the left hand type.  it is not allowed to call with non-compatible types */
MyBoolean				MustRightBePromotedToLeft(DataTypes LeftType, DataTypes RightType);

/* perform a type promotion on an expression */
struct ASTExpressionRec*	PromoteTheExpression(DataTypes OriginalType,
									DataTypes DesiredType, struct ASTExpressionRec* OriginalExpression,
									long LineNumber, struct TrashTrackRec* TrashTracker);

/* make sure the type is scalar */
MyBoolean				IsItAScalarType(DataTypes TheType);

/* make sure it is some kind of sequenced scalar */
MyBoolean				IsItASequencedScalarType(DataTypes TheType);

/* make sure it is some kind of indexed type */
MyBoolean				IsItAnIndexedType(DataTypes TheType);

#endif
