diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-01-20 12:25:38 +0000 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-01-20 12:25:38 +0000 |
commit | 0b23bc6179b7a8e6c8664374d7d6f66fe9c9bdcb (patch) | |
tree | 1114a5da66f23765fddfbba3ecdbd3f2ee0356eb /compiler_and_linker/unsorted/InlineAsmPPC.c | |
parent | 0905072b3ccfcb394b1dca2405a55cff4e2b9271 (diff) | |
download | MWCC-0b23bc6179b7a8e6c8664374d7d6f66fe9c9bdcb.tar.gz MWCC-0b23bc6179b7a8e6c8664374d7d6f66fe9c9bdcb.zip |
add PPCError error code enum
Diffstat (limited to 'compiler_and_linker/unsorted/InlineAsmPPC.c')
-rw-r--r-- | compiler_and_linker/unsorted/InlineAsmPPC.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/compiler_and_linker/unsorted/InlineAsmPPC.c b/compiler_and_linker/unsorted/InlineAsmPPC.c index 39a4056..464f9f9 100644 --- a/compiler_and_linker/unsorted/InlineAsmPPC.c +++ b/compiler_and_linker/unsorted/InlineAsmPPC.c @@ -77,26 +77,26 @@ static void IllegalObjectOperator(HashNameNode *name1, HashNameNode *name2, shor } if (!name2) { - PPCError_Error(119, opstr, name1->name); + PPCError_Error(PPCErrorStr119, opstr, name1->name); } else if (!name1) { - PPCError_Error(120, opstr, name2->name); + PPCError_Error(PPCErrorStr120, opstr, name2->name); } else { - PPCError_Error(118, name1->name, opstr, name2->name); + PPCError_Error(PPCErrorStr118, name1->name, opstr, name2->name); } } static void IllegalObjectInConst(IAExpr *expr) { if (expr->xC) { - PPCError_Error(122, expr->xC->name->name); + PPCError_Error(PPCErrorStr122, expr->xC->name->name); } else if (expr->object) { - PPCError_Error(122, expr->object->name->name); + PPCError_Error(PPCErrorStr122, expr->object->name->name); } else if (expr->label) { - PPCError_Error(166, expr->label->name->name); + PPCError_Error(PPCErrorStr166, expr->label->name->name); } } static void NotInRegisterError(char *name, char rclass) { - PPCError_Error(167, name, register_class_name[rclass]); + PPCError_Error(PPCErrorStr167, name, register_class_name[rclass]); } static int isregisteroperand(char rclass) { @@ -113,7 +113,7 @@ static SInt32 getcroperand(char rclass) { if (tk == TK_IDENTIFIER && (reg = InlineAsm_LookupRegisterPPCName(tkidentifier)) && reg->rclass == rclass) { value = reg->num; } else { - PPCError_Error(167, tkidentifier->name); + PPCError_Error(PPCErrorStr167, tkidentifier->name); } tk = lex(); @@ -345,13 +345,13 @@ static void DiadicOperatorPPC(IAExpr *left, short token, IAExpr *right) { if (left->xC) { if (right->label) - PPCError_Error(124, left->xC->name->name, right->label->name->name); + PPCError_Error(PPCErrorStr124, left->xC->name->name, right->label->name->name); if (right->xC) { if (left->x10) { - PPCError_Error(121, left->xC->name->name, left->x10->name->name, right->xC->name->name); + PPCError_Error(PPCErrorStr121, left->xC->name->name, left->x10->name->name, right->xC->name->name); } else if (right->x10) { - PPCError_Error(121, left->xC->name->name, right->xC->name->name, right->x10->name->name); + PPCError_Error(PPCErrorStr121, left->xC->name->name, right->xC->name->name, right->x10->name->name); } else if (token == '-') { left->value = CInt64_GetULong(&rightval); left->x10 = right->xC; @@ -365,7 +365,7 @@ static void DiadicOperatorPPC(IAExpr *left, short token, IAExpr *right) { } } else if (right->xC) { if (right->label) - PPCError_Error(124, right->xC->name->name, right->label->name->name); + PPCError_Error(PPCErrorStr124, right->xC->name->name, right->label->name->name); if (token == '+') { left->xC = right->xC; @@ -376,13 +376,13 @@ static void DiadicOperatorPPC(IAExpr *left, short token, IAExpr *right) { } } else if (left->label) { if (left->xC) - PPCError_Error(124, left->label->name->name, left->xC->name->name); + PPCError_Error(PPCErrorStr124, left->label->name->name, left->xC->name->name); if (right->label) { if (left->x18) { - PPCError_Error(121, left->label->name->name, left->x18->name->name, right->label->name->name); + PPCError_Error(PPCErrorStr121, left->label->name->name, left->x18->name->name, right->label->name->name); } else if (right->x18) { - PPCError_Error(121, left->label->name->name, right->label->name->name, right->x18->name->name); + PPCError_Error(PPCErrorStr121, left->label->name->name, right->label->name->name, right->x18->name->name); } else if (token == '-') { left->value = CInt64_GetULong(&rightval); left->x18 = right->label; @@ -412,7 +412,7 @@ static void DiadicOperatorPPC(IAExpr *left, short token, IAExpr *right) { left->type = right->type; } else { if (right->type != IAOpnd_Lab && right->type != left->type) - PPCError_Error(126); + PPCError_Error(PPCErrorStr126); } } @@ -538,7 +538,7 @@ static void floatoperand(IAOperand *op, InlineAsm *ia, Type *type) { ia->argcount++; op[1].type = IAOpnd_4; op[1].u.obj.obj = obj; - PPCError_Error(179); + PPCError_Error(PPCErrorStr179); op[1].u.obj.unk = IAExpr_2; op[1].u.obj.offset = 0; tk = lex(); @@ -601,7 +601,7 @@ static void memoryoperand(IAOperand *op, InlineAsm *ia, Boolean flag, short effe if (!flag) CError_Error(CErrorStr155); if (expr.xC) - PPCError_Error(122, expr.xC); + PPCError_Error(PPCErrorStr122, expr.xC); op[0].type = IAOpnd_Reg; op[0].u.reg.rclass = RegClass_GPR; @@ -619,7 +619,7 @@ static void memoryoperand(IAOperand *op, InlineAsm *ia, Boolean flag, short effe case IAExpr_5: expr.type = IAExpr_6; if (expr.object->datatype != DLOCAL || !OBJECT_REG(expr.object)) - PPCError_Error(180); + PPCError_Error(PPCErrorStr180); case IAExpr_2: case IAExpr_6: case IAExpr_7: @@ -636,7 +636,7 @@ static void memoryoperand(IAOperand *op, InlineAsm *ia, Boolean flag, short effe if (expr.xC) { if (expr.x10) - PPCError_Error(123, expr.xC->name->name, expr.x10->name->name); + PPCError_Error(PPCErrorStr123, expr.xC->name->name, expr.x10->name->name); if (flag) { if (tk == '(') { @@ -672,7 +672,7 @@ static void memoryoperand(IAOperand *op, InlineAsm *ia, Boolean flag, short effe op[0].type = IAOpnd_3; if (expr.type == IAExpr_5) { expr.type = IAExpr_6; - PPCError_Error(180); + PPCError_Error(PPCErrorStr180); } op[0].u.obj.unk = expr.type; } @@ -710,7 +710,7 @@ static void memoryoperand(IAOperand *op, InlineAsm *ia, Boolean flag, short effe op->u.labdiff.label2 = expr.x18; op->u.labdiff.offset = expr.value; } else { - PPCError_Error(125, expr.label->name->name); + PPCError_Error(PPCErrorStr125, expr.label->name->name); } } else { op->type = IAOpnd_Imm; @@ -770,7 +770,7 @@ static void registeroperand(IAOperand *op, char rclass, short effect) { } else if (tk == TK_IDENTIFIER) { NotInRegisterError(tkidentifier->name, rclass); } else { - PPCError_Error(171); + PPCError_Error(PPCErrorStr171); } tk = lex(); @@ -780,12 +780,12 @@ static void registeroperand(IAOperand *op, char rclass, short effect) { if (reg->object) op->u.reg.num = 1; else - PPCError_Error(168); + PPCError_Error(PPCErrorStr168); tk = lex(); } else if (rclass == RegClass_GPR) { if (reg->object && reg->object->type->size == 8) { HashNameNode *name = reg->object->name; - PPCError_Error(127, name->name, name->name, name->name); + PPCError_Error(PPCErrorStr127, name->name, name->name, name->name); } } } @@ -845,7 +845,7 @@ static void labeloperand(InlineAsm *ia, IAOperand *op, Boolean flag1, Boolean fl if (flag2) op->u.obj.unk = IAExpr_10; op->u.obj.unk = IAExpr_6; - PPCError_Error(180); + PPCError_Error(PPCErrorStr180); } } else { CError_Error(CErrorStr144); @@ -927,7 +927,7 @@ static void imm_or_labeldiff_operand(InlineAsm *ia, IAOperand *op, SInt32 minimu op->u.labdiff.label2 = expr.x18; op->u.labdiff.offset = expr.value; } else { - PPCError_Error(125, expr.label->name->name); + PPCError_Error(PPCErrorStr125, expr.label->name->name); } return; } @@ -946,14 +946,14 @@ static void imm_or_labeldiff_operand(InlineAsm *ia, IAOperand *op, SInt32 minimu op->type = IAOpnd_3; if (expr.type == IAExpr_5) { expr.type = IAExpr_6; - PPCError_Error(180); + PPCError_Error(PPCErrorStr180); } op->u.obj.unk = expr.type; } op->u.obj.obj = expr.xC; op->u.obj.offset = expr.value; } else { - PPCError_Error(123, expr.xC->name->name, expr.x10->name->name); + PPCError_Error(PPCErrorStr123, expr.xC->name->name, expr.x10->name->name); } return; } @@ -1992,9 +1992,9 @@ static PCode *InlineAsm_TranslateIRtoPCodePPC(InlineAsm *ia, int argcount, Assem r20 = OBJECT_REG(src->u.reg.object); } else { if (Registers_GetVarInfo(src->u.reg.object)->flags & VarInfoFlag40) - PPCError_Error(172, src->u.reg.object->name->name); + PPCError_Error(PPCErrorStr172, src->u.reg.object->name->name); else - PPCError_Error(167, src->u.reg.object->name->name); + PPCError_Error(PPCErrorStr167, src->u.reg.object->name->name); } } else if (src->u.reg.num == INVALID_PIC_REG) { r20 = pic_base_reg; @@ -2145,7 +2145,7 @@ void InlineAsm_TranslateIRtoPCode(Statement *stmt) { int i; for (i = 0; i < pc->argCount; i++) { if (pc->args[i].kind == PCOp_LABEL || pc->args[i].kind == PCOp_MEMORY) { - PPCError_Error(177); + PPCError_Error(PPCErrorStr177); break; } } |