if(inCompiler)
{
struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
+char * s;
if(inCompiler)
{
__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__List->_vTbl;
})[__ecereVMethodID___ecereNameSpace__ecere__com__Container_Add])(list, (&yylloc));
}
-ListAdd(list, MkExpString(QMkString(i18nModuleName ? i18nModuleName : "")));
+s = QMkString(i18nModuleName ? i18nModuleName : "");
+ListAdd(list, MkExpString(s));
+(__ecereNameSpace__ecere__com__eSystem_Delete(s), s = 0);
ListAdd(list, MkExpString(string));
if(context)
{
}
propWatch->compound = (((void *)0));
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(func));
-stmt->type = 3;
-stmt->expressions = MkList();
for(propID = (*propWatch->properties).first; propID; propID = propID->next)
{
struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, propID->string, privateModule);
struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
ListAdd(args, MkExpIdentifier(MkIdentifier("class")));
-ListAdd(args, MkExpString(QMkString(propID->string)));
+{
+char * s = QMkString(propID->string);
+
+ListAdd(args, MkExpString(s));
+(__ecereNameSpace__ecere__com__eSystem_Delete(s), s = 0);
+}
ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("eProperty_SelfWatch")), args));
}
}
else if(def->type == 5)
{
-stmt = MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("class"))), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("class")), MkIdentifier("designerClass")), '=', MkExpString(QMkString(def->designer))))), (((void *)0)));
+{
+char * s = QMkString(def->designer);
+
+stmt = MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("class"))), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("class")), MkIdentifier("designerClass")), '=', MkExpString(s)))), (((void *)0)));
+(__ecereNameSpace__ecere__com__eSystem_Delete(s), s = 0);
+}
ListAdd(registerModuleBody->compound.statements, stmt);
}
else if(def->type == 6)
}
else if(def->type == 8)
{
-stmt = MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("class"))), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("class")), MkIdentifier("defaultProperty")), '=', MkExpString(QMkString(def->defaultProperty->string))))), (((void *)0)));
+char * s = QMkString(def->defaultProperty->string);
+
+stmt = MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("class"))), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("class")), MkIdentifier("defaultProperty")), '=', MkExpString(s)))), (((void *)0)));
ListAdd(registerModuleBody->compound.statements, stmt);
+(__ecereNameSpace__ecere__com__eSystem_Delete(s), s = 0);
}
else if(def->type == 11)
{
struct __ecereNameSpace__ecere__sys__OldList * findClassArgs = MkList();
struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
struct Statement * compoundStmt;
+char * s;
ListAdd(findClassArgs, MkExpIdentifier(MkIdentifier("module")));
-ListAdd(findClassArgs, MkExpString(QMkString(__extension__ ({
+s = QMkString(__extension__ ({
char * __ecTemp1 = (((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&v)));
((struct ClassPropertyValue *)(__ecTemp1 + __ecereClass_ClassPropertyValue->offset));
-})->regClass->name)));
+})->regClass->name);
+ListAdd(findClassArgs, MkExpString(s));
+(__ecereNameSpace__ecere__com__eSystem_Delete(s), s = 0);
ListAdd(args, MkExpIdentifier(MkIdentifier("_class")));
-ListAdd(args, MkExpString(QMkString(__extension__ ({
+s = QMkString(__extension__ ({
char * __ecTemp1 = (((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&v)));
((struct ClassPropertyValue *)(__ecTemp1 + __ecereClass_ClassPropertyValue->offset));
-})->id->string)));
+})->id->string);
+ListAdd(args, MkExpString(s));
+(__ecereNameSpace__ecere__com__eSystem_Delete(s), s = 0);
ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(INT64)), (((void *)0))), __extension__ ({
char * __ecTemp1 = (((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&v)));
extern struct Expression * CopyExpression(struct Expression * exp);
+extern void FreeExpContents(struct Expression * exp);
+
extern void FreeExpression(struct Expression * exp);
void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
*memberExpPtr = (((void *)0));
newExp = CopyExpression(exp);
+FreeExpContents(exp);
*(struct Expression **)((unsigned char *)newExp + ((unsigned char *)memberExpPtr - (unsigned char *)exp)) = memberExp;
memberExp->member.exp = idExp;
exp->type = 5;
extern struct Identifier * MkIdentifier(char * string);
+extern void FreeSpecifier(struct Specifier * spec);
+
extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
-extern void FreeExpContents(struct Expression * exp);
+extern char * QMkString(char * source);
extern struct Expression * MkExpString(char * string);
-extern char * QMkString(char * source);
-
extern struct Specifier * MkSpecifier(int specifier);
extern void FreeIdentifier(struct Identifier * id);
extern void FinishTemplatesContext(struct Context * context);
+extern void FreeTypeName(struct TypeName * typeName);
+
extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
extern int ComputeTypeSize(struct Type * type);
-extern void FreeTypeName(struct TypeName * typeName);
-
extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
extern unsigned int internalValueCounter;
extern void DeclareStruct(char * name, unsigned int skipNoHead);
-extern void FreeSpecifier(struct Specifier * spec);
-
static void ProcessStatement(struct Statement * stmt);
extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
strcat(name, "_");
strcat(name, method->name);
(__ecereNameSpace__ecere__com__eSystem_Delete(exp->identifier->string), exp->identifier->string = 0);
+FreeSpecifier(exp->identifier->_class);
exp->identifier->_class = (((void *)0));
exp->identifier->string = __ecereNameSpace__ecere__sys__CopyString(name);
DeclareMethod(method, name);
exp->call.exp = MkExpIdentifier(MkIdentifier("ecere::com::eClass_SetProperty"));
exp->call.arguments = MkList();
ListAdd(exp->call.arguments, classExp);
-ListAdd(exp->call.arguments, MkExpString(QMkString(id->string)));
+{
+char * s = QMkString(id->string);
+
+ListAdd(exp->call.arguments, MkExpString(s));
+(__ecereNameSpace__ecere__com__eSystem_Delete(s), s = 0);
+}
ListAdd(exp->call.arguments, MkExpCast(MkTypeName(MkListOne(MkSpecifier(INT64)), (((void *)0))), value));
FreeIdentifier(id);
ProcessExpression(exp);
exp->op.exp2 = (((void *)0));
FreeExpContents(exp);
+FreeType(exp->expType);
+FreeType(exp->destType);
exp->expType = (((void *)0));
exp->destType = (((void *)0));
exp->op.op = INC_OP;
struct Specifier * firstSpec = firstParam ? (*firstParam->qualifiers).first : (((void *)0));
if(firstParam && firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
+{
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), (*funcDecl->function.parameters).first);
+FreeTypeName(firstParam);
+}
}
if(method->dataType->thisClass && !strcmp(method->dataType->thisClass->string, "class"))
{
{
struct Type * destType = (destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), destType->refCount = 1, destType->kind = 8, destType->classObjectType = 3, destType);
+FreeType((parentExp ? parentExp : newExp)->expType);
+FreeType((parentExp ? parentExp : newExp)->destType);
(parentExp ? parentExp : newExp)->expType = checkedExp->expType;
(parentExp ? parentExp : newExp)->destType = destType;
if(checkedExp->expType)
exp->call.exp = MkExpIdentifier(MkIdentifier("ecere::com::eClass_GetProperty"));
exp->call.arguments = MkList();
ListAdd(exp->call.arguments, classExp);
-ListAdd(exp->call.arguments, MkExpString(QMkString(id->string)));
+{
+char * s = QMkString(id->string);
+
+ListAdd(exp->call.arguments, MkExpString(s));
+(__ecereNameSpace__ecere__com__eSystem_Delete(s), s = 0);
+}
FreeIdentifier(id);
ProcessExpression(exp);
return ;
if(!_class->symbol)
_class->symbol = FindClass(_class->fullName);
DeclareClass(_class->symbol, className);
+FreeExpression(exp->member.exp);
exp->index.exp = MkExpPointer(MkExpIdentifier(MkIdentifier(className)), MkIdentifier("_vTbl"));
}
else
if(inCompiler)
{
OldList * list = MkList();
+ String s;
if(inCompiler)
{
ContextStringPair pair { };
list.Add(yylloc);
}
//ListAdd(list, QMkExpId("__thisModule"));
- ListAdd(list, MkExpString(QMkString(i18nModuleName ? i18nModuleName : "")));
+ s = QMkString(i18nModuleName ? i18nModuleName : "");
+ ListAdd(list, MkExpString(s));
+ delete s;
ListAdd(list, MkExpString(string));
if(context)
{
propWatch.compound = null;
definitions.Insert(null, MkClassDefFunction(func));
- stmt.type = expressionStmt;
- stmt.expressions = MkList();
-
for(propID = propWatch.properties->first; propID; propID = propID.next)
{
Property prop = eClass_FindProperty(regClass, propID.string, privateModule);
// eProperty_SelfWatch(_class, name, callback);
OldList * args = MkList();
ListAdd(args, MkExpIdentifier(MkIdentifier("class")));
- ListAdd(args, MkExpString(QMkString(propID.string)));
+ {
+ char * s = QMkString(propID.string);
+ ListAdd(args, MkExpString(s));
+ delete s;
+ }
ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
ListAdd(stmt.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("eProperty_SelfWatch")), args));
DeclareClass(FindClass(def.designer), className);
*/
- stmt = MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("class"))), MkExpressionStmt(MkListOne(
- MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("class")), MkIdentifier("designerClass")), '=',
- MkExpString(QMkString(def.designer))))), null);
+ {
+ char * s = QMkString(def.designer);
+ stmt = MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("class"))), MkExpressionStmt(MkListOne(
+ MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("class")), MkIdentifier("designerClass")), '=',
+ MkExpString(s)))), null);
+ delete s;
+ }
ListAdd(registerModuleBody.compound.statements, stmt);
}
else if(def.type == classNoExpansionClassDef)
}
else if(def.type == designerDefaultPropertyClassDef)
{
+ char * s = QMkString(def.defaultProperty.string);
stmt = MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("class"))), MkExpressionStmt(MkListOne(
MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("class")), MkIdentifier("defaultProperty")), '=',
- MkExpString(QMkString(def.defaultProperty.string))))), null);
+ MkExpString(s)))), null);
ListAdd(registerModuleBody.compound.statements, stmt);
+ delete s;
}
else if(def.type == classPropertyValueClassDef)
{
OldList * findClassArgs = MkList();
OldList * args = MkList();
Statement compoundStmt;
+ String s;
ListAdd(findClassArgs, MkExpIdentifier(MkIdentifier("module")));
- ListAdd(findClassArgs, MkExpString(QMkString(v.regClass.name)));
+ s = QMkString(v.regClass.name);
+ ListAdd(findClassArgs, MkExpString(s));
+ delete s;
ListAdd(args, MkExpIdentifier(MkIdentifier("_class")));
- ListAdd(args, MkExpString(QMkString(v.id.string)));
+ s = QMkString(v.id.string);
+ ListAdd(args, MkExpString(s));
+ delete s;
ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(INT64)), null), v.exp));
compoundStmt = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("ecere::com::Class")),
MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("_class")),
*memberExpPtr = null;
newExp = CopyExpression(exp);
+ FreeExpContents(exp);
+
*(Expression *)((byte *)newExp + (uint)((byte *)memberExpPtr - (byte *)exp)) = memberExp;
memberExp.member.exp = idExp;
strcat(name, method.name);
delete exp.identifier.string;
+ FreeSpecifier(exp.identifier._class);
exp.identifier._class = null;
exp.identifier.string = CopyString(name);
exp.call.exp = MkExpIdentifier(MkIdentifier("ecere::com::eClass_SetProperty"));
exp.call.arguments = MkList();
ListAdd(exp.call.arguments, classExp);
- ListAdd(exp.call.arguments, MkExpString(QMkString(id.string)));
+ {
+ char * s = QMkString(id.string);
+ ListAdd(exp.call.arguments, MkExpString(s));
+ delete s;
+ }
ListAdd(exp.call.arguments, MkExpCast(MkTypeName(MkListOne(MkSpecifier(INT64)), null), value));
FreeIdentifier(id);
Expression object = exp.op.exp2;
exp.op.exp2 = null;
FreeExpContents(exp);
+ FreeType(exp.expType);
+ FreeType(exp.destType);
exp.expType = null;
exp.destType = null;
exp.op.op = INC_OP;
Specifier firstSpec = firstParam ? firstParam.qualifiers->first : null;
if(firstParam && firstSpec && firstSpec.type == baseSpecifier && firstSpec.specifier == VOID && !firstParam.declarator)
+ {
funcDecl.function.parameters->Remove(funcDecl.function.parameters->first);
+ FreeTypeName(firstParam);
+ }
}
if(method.dataType.thisClass && !strcmp(method.dataType.thisClass.string, "class"))
if(typedObject && !memberExp.member.exp.expType.classObjectType)
{
Type destType { refCount = 1, kind = classType, classObjectType = ClassObjectType::anyObject };
+ FreeType((parentExp ? parentExp : newExp).expType);
+ FreeType((parentExp ? parentExp : newExp).destType);
(parentExp ? parentExp : newExp).expType = checkedExp.expType;
(parentExp ? parentExp : newExp).destType = destType;
if(checkedExp.expType) checkedExp.expType.refCount++;
exp.call.exp = MkExpIdentifier(MkIdentifier("ecere::com::eClass_GetProperty"));
exp.call.arguments = MkList();
ListAdd(exp.call.arguments, classExp);
- ListAdd(exp.call.arguments, MkExpString(QMkString(id.string)));
+ {
+ char * s = QMkString(id.string);
+ ListAdd(exp.call.arguments, MkExpString(s));
+ delete s;
+ }
FreeIdentifier(id);
ProcessExpression(exp);
if(!_class.symbol)
_class.symbol = FindClass(_class.fullName);
DeclareClass(_class.symbol, className);
- exp.index.exp = MkExpPointer(MkExpIdentifier(MkIdentifier(className)), MkIdentifier("_vTbl"));
- // WHAT HAPPENS TO exp.member.exp ?
+ FreeExpression(exp.member.exp);
+ exp.index.exp = MkExpPointer(MkExpIdentifier(MkIdentifier(className)), MkIdentifier("_vTbl"));
}
else
{