mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-05-05 01:41:30 +02:00
Merge dmd-1.073.
This commit is contained in:
@@ -74,6 +74,8 @@ namespace llvm {
|
||||
|
||||
void initPrecedence();
|
||||
|
||||
typedef int (*apply_fp_t)(Expression *, void *);
|
||||
|
||||
Expression *resolveProperties(Scope *sc, Expression *e);
|
||||
void accessCheck(Loc loc, Scope *sc, Expression *e, Declaration *d);
|
||||
Dsymbol *search_function(AggregateDeclaration *ad, Identifier *funcid);
|
||||
@@ -111,6 +113,7 @@ struct Expression : Object
|
||||
Expression(Loc loc, enum TOK op, int size);
|
||||
Expression *copy();
|
||||
virtual Expression *syntaxCopy();
|
||||
virtual int apply(apply_fp_t fp, void *param);
|
||||
virtual Expression *semantic(Scope *sc);
|
||||
Expression *trySemantic(Scope *sc);
|
||||
|
||||
@@ -121,7 +124,7 @@ struct Expression : Object
|
||||
virtual void dump(int indent);
|
||||
void error(const char *format, ...) IS_PRINTF(2);
|
||||
void warning(const char *format, ...) IS_PRINTF(2);
|
||||
virtual void rvalue();
|
||||
virtual int rvalue();
|
||||
|
||||
static Expression *combine(Expression *e1, Expression *e2);
|
||||
static Expressions *arraySyntaxCopy(Expressions *exps);
|
||||
@@ -153,7 +156,6 @@ struct Expression : Object
|
||||
Expression *integralPromotions(Scope *sc);
|
||||
|
||||
Expression *toDelegate(Scope *sc, Type *t);
|
||||
virtual void scanForNestedRef(Scope *sc);
|
||||
|
||||
virtual Expression *optimize(int result);
|
||||
#define WANTflags 1
|
||||
@@ -168,10 +170,11 @@ struct Expression : Object
|
||||
virtual int isConst();
|
||||
virtual int isBool(int result);
|
||||
virtual int isBit();
|
||||
bool hasSideEffect();
|
||||
virtual int checkSideEffect(int flag);
|
||||
virtual int canThrow();
|
||||
|
||||
virtual int inlineCost(InlineCostState *ics);
|
||||
virtual int inlineCost3(InlineCostState *ics);
|
||||
virtual Expression *doInline(InlineDoState *ids);
|
||||
virtual Expression *inlineScan(InlineScanState *iss);
|
||||
Expression *inlineCopy(Scope *sc);
|
||||
@@ -342,9 +345,8 @@ struct ThisExp : Expression
|
||||
int isBool(int result);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
Expression *toLvalue(Scope *sc, Expression *e);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
int inlineCost3(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
//Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -362,9 +364,7 @@ struct SuperExp : ThisExp
|
||||
SuperExp(Loc loc);
|
||||
Expression *semantic(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
//Expression *inlineScan(InlineScanState *iss);
|
||||
};
|
||||
@@ -399,6 +399,7 @@ struct StringExp : Expression
|
||||
unsigned char sz; // 1: char, 2: wchar, 4: dchar
|
||||
unsigned char committed; // !=0 if type is committed
|
||||
unsigned char postfix; // 'c', 'w', 'd'
|
||||
bool ownedByCtfe; // true = created in CTFE
|
||||
|
||||
StringExp(Loc loc, char *s);
|
||||
StringExp(Loc loc, void *s, size_t len);
|
||||
@@ -436,10 +437,10 @@ struct TupleExp : Expression
|
||||
TupleExp(Loc loc, Expressions *exps);
|
||||
TupleExp(Loc loc, TupleDeclaration *tup);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
int equals(Object *o);
|
||||
Expression *semantic(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
void checkEscape();
|
||||
int checkSideEffect(int flag);
|
||||
Expression *optimize(int result);
|
||||
@@ -449,7 +450,6 @@ struct TupleExp : Expression
|
||||
elem *toElem(IRState *irs);
|
||||
#endif
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -461,24 +461,24 @@ struct TupleExp : Expression
|
||||
struct ArrayLiteralExp : Expression
|
||||
{
|
||||
Expressions *elements;
|
||||
bool ownedByCtfe; // true = created in CTFE
|
||||
|
||||
ArrayLiteralExp(Loc loc, Expressions *elements);
|
||||
ArrayLiteralExp(Loc loc, Expression *e);
|
||||
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
int isBool(int result);
|
||||
int checkSideEffect(int flag);
|
||||
StringExp *toString();
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void toMangleBuffer(OutBuffer *buf);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
Expression *optimize(int result);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
MATCH implicitConvTo(Type *t);
|
||||
Expression *castTo(Scope *sc, Type *t);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -495,10 +495,12 @@ struct AssocArrayLiteralExp : Expression
|
||||
{
|
||||
Expressions *keys;
|
||||
Expressions *values;
|
||||
bool ownedByCtfe; // true = created in CTFE
|
||||
|
||||
AssocArrayLiteralExp(Loc loc, Expressions *keys, Expressions *values);
|
||||
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
int isBool(int result);
|
||||
#if IN_DMD
|
||||
@@ -507,13 +509,11 @@ struct AssocArrayLiteralExp : Expression
|
||||
int checkSideEffect(int flag);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void toMangleBuffer(OutBuffer *buf);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
Expression *optimize(int result);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
MATCH implicitConvTo(Type *t);
|
||||
Expression *castTo(Scope *sc, Type *t);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -535,22 +535,23 @@ struct StructLiteralExp : Expression
|
||||
#endif
|
||||
size_t soffset; // offset from start of s
|
||||
int fillHoles; // fill alignment 'holes' with zero
|
||||
bool ownedByCtfe; // true = created in CTFE
|
||||
|
||||
StructLiteralExp(Loc loc, StructDeclaration *sd, Expressions *elements, Type *stype = NULL);
|
||||
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
Expression *getField(Type *type, unsigned offset);
|
||||
int getFieldIndex(Type *type, unsigned offset);
|
||||
int checkSideEffect(int flag);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void toMangleBuffer(OutBuffer *buf);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
Expression *optimize(int result);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
Expression *toLvalue(Scope *sc, Expression *e);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
int inlineCost3(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -610,7 +611,7 @@ struct TemplateExp : Expression
|
||||
TemplateDeclaration *td;
|
||||
|
||||
TemplateExp(Loc loc, TemplateDeclaration *td);
|
||||
void rvalue();
|
||||
int rvalue();
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
};
|
||||
|
||||
@@ -630,6 +631,7 @@ struct NewExp : Expression
|
||||
NewExp(Loc loc, Expression *thisexp, Expressions *newargs,
|
||||
Type *newtype, Expressions *arguments);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
Expression *optimize(int result);
|
||||
@@ -638,9 +640,8 @@ struct NewExp : Expression
|
||||
#endif
|
||||
int checkSideEffect(int flag);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
//int inlineCost(InlineCostState *ics);
|
||||
//int inlineCost3(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
//Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -661,6 +662,7 @@ struct NewAnonClassExp : Expression
|
||||
NewAnonClassExp(Loc loc, Expression *thisexp, Expressions *newargs,
|
||||
ClassDeclaration *cd, Expressions *arguments);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
int checkSideEffect(int flag);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
@@ -696,7 +698,6 @@ struct SymOffExp : Expression
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
MATCH implicitConvTo(Type *t);
|
||||
Expression *castTo(Scope *sc, Type *t);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
#if IN_DMD
|
||||
elem *toElem(IRState *irs);
|
||||
@@ -731,9 +732,7 @@ struct VarExp : Expression
|
||||
elem *toElem(IRState *irs);
|
||||
dt_t **toDt(dt_t **pdt);
|
||||
#endif
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
//Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -767,7 +766,6 @@ struct FuncExp : Expression
|
||||
Expression *syntaxCopy();
|
||||
Expression *semantic(Scope *sc);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
char *toChars();
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
#if IN_DMD
|
||||
@@ -775,7 +773,7 @@ struct FuncExp : Expression
|
||||
dt_t **toDt(dt_t **pdt);
|
||||
#endif
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
int inlineCost3(InlineCostState *ics);
|
||||
//Expression *doInline(InlineDoState *ids);
|
||||
//Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -800,9 +798,8 @@ struct DeclarationExp : Expression
|
||||
#if IN_DMD
|
||||
elem *toElem(IRState *irs);
|
||||
#endif
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
int inlineCost3(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -875,14 +872,13 @@ struct UnaExp : Expression
|
||||
|
||||
UnaExp(Loc loc, enum TOK op, int size, Expression *e1);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
Expression *optimize(int result);
|
||||
void dump(int indent);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
Expression *interpretCommon(InterState *istate, CtfeGoal goal, Expression *(*fp)(Type *, Expression *));
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -896,6 +892,7 @@ struct BinExp : Expression
|
||||
|
||||
BinExp(Loc loc, enum TOK op, int size, Expression *e1, Expression *e2);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
Expression *semanticp(Scope *sc);
|
||||
Expression *commonSemanticAssign(Scope *sc);
|
||||
@@ -910,7 +907,6 @@ struct BinExp : Expression
|
||||
int isunsigned();
|
||||
void incompatibleTypes();
|
||||
void dump(int indent);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
Expression *interpretCommon(InterState *istate, CtfeGoal goal,
|
||||
Expression *(*fp)(Type *, Expression *, Expression *));
|
||||
Expression *interpretCommon2(InterState *istate, CtfeGoal goal,
|
||||
@@ -919,7 +915,6 @@ struct BinExp : Expression
|
||||
Expression *(*fp)(Type *, Expression *, Expression *), int post = 0);
|
||||
Expression *arrayOp(Scope *sc);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -958,12 +953,12 @@ struct AssertExp : UnaExp
|
||||
|
||||
AssertExp(Loc loc, Expression *e, Expression *msg = NULL);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
int checkSideEffect(int flag);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -1040,7 +1035,7 @@ struct DelegateExp : UnaExp
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void dump(int indent);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
int inlineCost3(InlineCostState *ics);
|
||||
#if IN_DMD
|
||||
elem *toElem(IRState *irs);
|
||||
#endif
|
||||
@@ -1076,6 +1071,7 @@ struct CallExp : UnaExp
|
||||
CallExp(Loc loc, Expression *e, Expression *earg1, Expression *earg2);
|
||||
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
Expression *optimize(int result);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
@@ -1085,11 +1081,10 @@ struct CallExp : UnaExp
|
||||
#if IN_DMD
|
||||
elem *toElem(IRState *irs);
|
||||
#endif
|
||||
void scanForNestedRef(Scope *sc);
|
||||
Expression *toLvalue(Scope *sc, Expression *e);
|
||||
Expression *modifiableLvalue(Scope *sc, Expression *e);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
int inlineCost3(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -1276,6 +1271,7 @@ struct SliceExp : UnaExp
|
||||
|
||||
SliceExp(Loc loc, Expression *e1, Expression *lwr, Expression *upr);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
void checkEscape();
|
||||
void checkEscapeRef();
|
||||
@@ -1289,12 +1285,10 @@ struct SliceExp : UnaExp
|
||||
#if IN_DMD
|
||||
elem *toElem(IRState *irs);
|
||||
#endif
|
||||
void scanForNestedRef(Scope *sc);
|
||||
void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
|
||||
Expression *buildArrayLoop(Parameters *fparams);
|
||||
int canThrow();
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -1328,15 +1322,14 @@ struct ArrayExp : UnaExp
|
||||
|
||||
ArrayExp(Loc loc, Expression *e1, Expressions *arguments);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
Expression *toLvalue(Scope *sc, Expression *e);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
// For operator overloading
|
||||
Identifier *opId();
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
};
|
||||
@@ -1385,7 +1378,6 @@ struct IndexExp : BinExp
|
||||
Expression *optimize(int result);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
#if IN_DMD
|
||||
elem *toElem(IRState *irs);
|
||||
@@ -1899,6 +1891,7 @@ struct CondExp : BinExp
|
||||
|
||||
CondExp(Loc loc, Expression *econd, Expression *e1, Expression *e2);
|
||||
Expression *syntaxCopy();
|
||||
int apply(apply_fp_t fp, void *param);
|
||||
Expression *semantic(Scope *sc);
|
||||
Expression *optimize(int result);
|
||||
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
|
||||
@@ -1911,9 +1904,7 @@ struct CondExp : BinExp
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
MATCH implicitConvTo(Type *t);
|
||||
Expression *castTo(Scope *sc, Type *t);
|
||||
void scanForNestedRef(Scope *sc);
|
||||
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
|
||||
@@ -2015,4 +2006,11 @@ Expression *Identity(enum TOK op, Type *type, Expression *e1, Expression *e2);
|
||||
|
||||
Expression *Slice(Type *type, Expression *e1, Expression *lwr, Expression *upr);
|
||||
|
||||
// Const-folding functions used by CTFE
|
||||
|
||||
void sliceAssignArrayLiteralFromString(ArrayLiteralExp *existingAE, StringExp *newval, int firstIndex);
|
||||
void sliceAssignStringFromArrayLiteral(StringExp *existingSE, ArrayLiteralExp *newae, int firstIndex);
|
||||
void sliceAssignStringFromString(StringExp *existingSE, StringExp *newstr, int firstIndex);
|
||||
|
||||
|
||||
#endif /* DMD_EXPRESSION_H */
|
||||
|
||||
Reference in New Issue
Block a user