summaryrefslogtreecommitdiff
path: root/compiler_and_linker
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-20 12:25:38 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-20 12:25:38 +0000
commit0b23bc6179b7a8e6c8664374d7d6f66fe9c9bdcb (patch)
tree1114a5da66f23765fddfbba3ecdbd3f2ee0356eb /compiler_and_linker
parent0905072b3ccfcb394b1dca2405a55cff4e2b9271 (diff)
downloadMWCC-0b23bc6179b7a8e6c8664374d7d6f66fe9c9bdcb.tar.gz
MWCC-0b23bc6179b7a8e6c8664374d7d6f66fe9c9bdcb.zip
add PPCError error code enum
Diffstat (limited to '')
-rw-r--r--compiler_and_linker/unsorted/CExpr.c2
-rw-r--r--compiler_and_linker/unsorted/CodeGen.c98
-rw-r--r--compiler_and_linker/unsorted/Coloring.c2
-rw-r--r--compiler_and_linker/unsorted/FuncLevelAsmPPC.c10
-rw-r--r--compiler_and_linker/unsorted/InlineAsmPPC.c64
-rw-r--r--compiler_and_linker/unsorted/InlineAsmRegistersPPC.c16
-rw-r--r--compiler_and_linker/unsorted/Intrinsics.c40
-rw-r--r--compiler_and_linker/unsorted/PCodeAssembly.c6
-rw-r--r--compiler_and_linker/unsorted/PPCError.c2
-rw-r--r--compiler_and_linker/unsorted/TOC.c2
10 files changed, 121 insertions, 121 deletions
diff --git a/compiler_and_linker/unsorted/CExpr.c b/compiler_and_linker/unsorted/CExpr.c
index 23fe22f..484f56d 100644
--- a/compiler_and_linker/unsorted/CExpr.c
+++ b/compiler_and_linker/unsorted/CExpr.c
@@ -1392,7 +1392,7 @@ static ENode *CExpr_ParseVecStep(void) {
}
expr = intconstnode(TYPE(&stsignedint), value);
} else {
- PPCError_Error(104, "vec_step", "vec_step", type, 0);
+ PPCError_Error(PPCErrorStr104, "vec_step", "vec_step", type, 0);
}
} else {
CError_Error(CErrorStr114);
diff --git a/compiler_and_linker/unsorted/CodeGen.c b/compiler_and_linker/unsorted/CodeGen.c
index 908f71b..986bddc 100644
--- a/compiler_and_linker/unsorted/CodeGen.c
+++ b/compiler_and_linker/unsorted/CodeGen.c
@@ -1344,7 +1344,7 @@ static void pragma_scheduling(void) {
return;
}
} else {
- PPCError_Error(115);
+ PPCError_Error(PPCErrorStr115);
return;
}
CPrep_Error(CErrorStr186);
@@ -1616,14 +1616,14 @@ void CodeGen_ParsePragma(HashNameNode *name) {
CPrep_PushOption(OPT_OFFSET(function_align), value);
break;
default:
- PPCError_Warning(161);
+ PPCError_Warning(PPCErrorStr161);
CodeGen_EOLCheck();
return;
}
} else if (t == TK_IDENTIFIER && !strcmp(tkidentifier->name, "reset")) {
CPrep_PopOption(OPT_OFFSET(function_align));
} else {
- PPCError_Warning(161);
+ PPCError_Warning(PPCErrorStr161);
}
CodeGen_EOLCheck();
return;
@@ -1631,7 +1631,7 @@ void CodeGen_ParsePragma(HashNameNode *name) {
if (!strcmp(name->name, "processor")) {
if (cscope_currentfunc) {
- PPCError_Warning(156, "pragma processor");
+ PPCError_Warning(PPCErrorStr156, "pragma processor");
return;
}
t = plex();
@@ -1701,7 +1701,7 @@ void CodeGen_ParsePragma(HashNameNode *name) {
copts.processor = 21;
break;
default:
- PPCError_Warning(208);
+ PPCError_Warning(PPCErrorStr208);
CodeGen_EOLCheck();
return;
}
@@ -1717,9 +1717,9 @@ void CodeGen_ParsePragma(HashNameNode *name) {
else if (!strcmp(tkidentifier->name, "PPC604e"))
copts.processor = 10;
else
- PPCError_Warning(208);
+ PPCError_Warning(PPCErrorStr208);
} else {
- PPCError_Warning(208);
+ PPCError_Warning(PPCErrorStr208);
}
if ((str = CMach_GetCPU()))
@@ -1743,7 +1743,7 @@ void CodeGen_ParsePragma(HashNameNode *name) {
CPrep_PushOption(OPT_OFFSET(min_struct_alignment), value);
break;
default:
- PPCError_Warning(191);
+ PPCError_Warning(PPCErrorStr191);
CodeGen_EOLCheck();
return;
}
@@ -1755,7 +1755,7 @@ void CodeGen_ParsePragma(HashNameNode *name) {
else if (!strcmp(tkidentifier->name, "off"))
CPrep_PushOption(OPT_OFFSET(min_struct_alignment), 1);
} else {
- PPCError_Warning(161);
+ PPCError_Warning(PPCErrorStr161);
}
CodeGen_EOLCheck();
@@ -1806,7 +1806,7 @@ void CodeGen_ParsePragma(HashNameNode *name) {
} else if (!strcmp(tkidentifier->name, "on")) {
copts.codegen_pic = 1;
if (!copts.codegen_dynamic) {
- PPCError_Error(189);
+ PPCError_Error(PPCErrorStr189);
copts.codegen_pic = 0;
}
} else {
@@ -2031,9 +2031,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
case STRUCT_VECTOR_SCHAR:
case STRUCT_VECTOR_BCHAR:
if (i < 15) {
- PPCError_Error(110, type, 0);
+ PPCError_Error(PPCErrorStr110, type, 0);
} else if (i > 15) {
- PPCError_Error(111, type, 0);
+ PPCError_Error(PPCErrorStr111, type, 0);
} else {
escan = expr;
i = 15;
@@ -2042,17 +2042,17 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
expr = escan->data.diadic.right;
v = expr->data.intval;
if (!ENODE_IS(expr, EINTCONST)) {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 1))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
@@ -2065,15 +2065,15 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 1))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
vec->uc[0] = (UInt8) v.lo;
} else {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
result = 1;
@@ -2085,9 +2085,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
case STRUCT_VECTOR_BSHORT:
case STRUCT_VECTOR_PIXEL:
if (i < 7) {
- PPCError_Error(110, type, 0);
+ PPCError_Error(PPCErrorStr110, type, 0);
} else if (i > 7) {
- PPCError_Error(111, type, 0);
+ PPCError_Error(PPCErrorStr111, type, 0);
} else {
escan = expr;
i = 7;
@@ -2095,17 +2095,17 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
ENode *e = escan->data.diadic.right;
CInt64 v = e->data.intval;
if (!ENODE_IS(e, EINTCONST)) {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
if (!CInt64_IsInURange(v, 2))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 2))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
@@ -2118,15 +2118,15 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
if (!CInt64_IsInURange(v, 2))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 2))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
vec->us[0] = (UInt16) v.lo;
} else {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
result = 1;
@@ -2137,9 +2137,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
case STRUCT_VECTOR_SINT:
case STRUCT_VECTOR_BINT:
if (i < 3) {
- PPCError_Error(110, type, 0);
+ PPCError_Error(PPCErrorStr110, type, 0);
} else if (i > 3) {
- PPCError_Error(111, type, 0);
+ PPCError_Error(PPCErrorStr111, type, 0);
} else {
escan = expr;
i = 3;
@@ -2148,17 +2148,17 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
expr = escan->data.diadic.right;
v = expr->data.intval;
if (!ENODE_IS(expr, EINTCONST)) {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 4))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
@@ -2171,15 +2171,15 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 4))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
vec->ul[0] = v.lo;
} else {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
result = 1;
@@ -2188,9 +2188,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
case STRUCT_VECTOR_FLOAT:
if (i < 3) {
- PPCError_Error(110, type, 0);
+ PPCError_Error(PPCErrorStr110, type, 0);
} else if (i > 3) {
- PPCError_Error(111, type, 0);
+ PPCError_Error(PPCErrorStr111, type, 0);
} else {
Float fv;
escan = expr;
@@ -2203,7 +2203,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
fv = CMach_CalcFloatConvertFromInt(expr->rtype,
expr->data.intval);
} else {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
@@ -2217,7 +2217,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} else if (ENODE_IS(escan, EINTCONST)) {
fv = CMach_CalcFloatConvertFromInt(escan->rtype, escan->data.intval);
} else {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
@@ -2237,10 +2237,10 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 1))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
while (i < 16)
@@ -2257,10 +2257,10 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
if (!CInt64_IsInURange(v, 2))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 2))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
while (i < 8)
@@ -2276,10 +2276,10 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
} else {
if (!CInt64_IsInRange(v, 4))
- PPCError_Warning(113, type, 0);
+ PPCError_Warning(PPCErrorStr113, type, 0);
}
}
while (i < 4)
@@ -2291,7 +2291,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
{
Float fv;
if (!CInt64_IsInRange(expr->data.intval, 4)) {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
}
fv = CMach_CalcFloatConvertFromInt(expr->rtype, expr->data.intval);
@@ -2301,12 +2301,12 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
break;
}
default:
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
}
} else if (ENODE_IS(expr, EFLOATCONST)) {
switch (TYPE_STRUCT(type)->stype) {
default:
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
break;
case STRUCT_VECTOR_FLOAT:
{
@@ -2322,9 +2322,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
}
} else if (ENODE_IS2(expr, EINDIRECT, EFUNCCALL)) {
if (!IS_TYPE_STRUCT(expr->rtype))
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
} else if (!ENODE_IS(expr, EVECTOR128CONST)) {
- PPCError_Error(112);
+ PPCError_Error(PPCErrorStr112);
}
return result;
diff --git a/compiler_and_linker/unsorted/Coloring.c b/compiler_and_linker/unsorted/Coloring.c
index 82a87f3..8036435 100644
--- a/compiler_and_linker/unsorted/Coloring.c
+++ b/compiler_and_linker/unsorted/Coloring.c
@@ -243,7 +243,7 @@ void colorinstructions(Object *proc) {
save_before_coloring_nonvolatile_registers(rclass);
used_regs_before_coloring = used_virtual_registers[rclass];
if (!available_registers(rclass)) {
- PPCError_Error(102, register_class_name[rclass]);
+ PPCError_Error(PPCErrorStr102, register_class_name[rclass]);
return;
}
diff --git a/compiler_and_linker/unsorted/FuncLevelAsmPPC.c b/compiler_and_linker/unsorted/FuncLevelAsmPPC.c
index 8b45459..27528b8 100644
--- a/compiler_and_linker/unsorted/FuncLevelAsmPPC.c
+++ b/compiler_and_linker/unsorted/FuncLevelAsmPPC.c
@@ -191,7 +191,7 @@ void Assembler(Object *func) {
CodeGen_InitialSanityCheck();
if (func->qual & Q_INLINE)
- PPCError_Warning(173);
+ PPCError_Warning(PPCErrorStr173);
CheckCLabels();
@@ -265,7 +265,7 @@ void Assembler(Object *func) {
FuncAsm_AddEntryPoint(stmt, pclastblock);
} else if (ia->opcode == IADirective_FrFree) {
if (flag16)
- PPCError_Error(188);
+ PPCError_Error(PPCErrorStr188);
else
flag16 = 1;
@@ -362,11 +362,11 @@ void Assembler(Object *func) {
if (!asm_alloc_flags[1] && needs_frame()) {
if (asm_alloc_flags[3]) {
if (!asm_alloc_flags[5] || !asm_alloc_flags[6])
- PPCError_Warning(187, "blr");
+ PPCError_Warning(PPCErrorStr187, "blr");
if (asm_alloc_flags[8])
- PPCError_Warning(186);
+ PPCError_Warning(PPCErrorStr186);
} else {
- PPCError_Warning(185, "blr");
+ PPCError_Warning(PPCErrorStr185, "blr");
}
}
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;
}
}
diff --git a/compiler_and_linker/unsorted/InlineAsmRegistersPPC.c b/compiler_and_linker/unsorted/InlineAsmRegistersPPC.c
index c85b216..0aed627 100644
--- a/compiler_and_linker/unsorted/InlineAsmRegistersPPC.c
+++ b/compiler_and_linker/unsorted/InlineAsmRegistersPPC.c
@@ -691,7 +691,7 @@ IARegister *InlineAsm_LookupRegisterPPC(char *name) {
if (reg) {
if (copts.warn_possunwant)
- PPCError_Warning(117, name);
+ PPCError_Warning(PPCErrorStr117, name);
return reg;
}
@@ -701,7 +701,7 @@ IARegister *InlineAsm_LookupRegisterPPC(char *name) {
Boolean overflow;
ScanDec(buf + 3, &result, &overflow);
if (overflow || result > 1024) {
- PPCError_Error(117, name);
+ PPCError_Error(PPCErrorStr117, name);
return NULL;
}
@@ -713,10 +713,10 @@ IARegister *InlineAsm_LookupRegisterPPC(char *name) {
if (copts.warn_possunwant) {
if (cpu == CPUMask_Generic) {
if ((cpu & CPUFLAG_LOW_MASK) != ((cpu & CPUFLAG_LOW_MASK) & spr_cpus[result]))
- PPCError_Warning(117, name);
+ PPCError_Warning(PPCErrorStr117, name);
} else {
if (!(cpu & spr_cpus[result]))
- PPCError_Warning(117, name);
+ PPCError_Warning(PPCErrorStr117, name);
}
}
@@ -754,7 +754,7 @@ IARegister *InlineAsm_LookupDCRRegister(char *name) {
if (reg) {
if (copts.warn_possunwant)
- PPCError_Warning(117, name);
+ PPCError_Warning(PPCErrorStr117, name);
return reg;
}
@@ -764,7 +764,7 @@ IARegister *InlineAsm_LookupDCRRegister(char *name) {
Boolean overflow;
ScanDec(buf + 3, &result, &overflow);
if (overflow || result > 1024) {
- PPCError_Error(117, name);
+ PPCError_Error(PPCErrorStr117, name);
return NULL;
}
@@ -817,7 +817,7 @@ void InlineAsm_InitializeRegistersPPC(void) {
sprintf(buf, "{?}%" PRId32, asmreg->num);
break;
}
- PPCError_Warning(100, obj->name->name, buf);
+ PPCError_Warning(PPCErrorStr100, obj->name->name, buf);
}
}
for (list = locals; list; list = list->next) {
@@ -841,7 +841,7 @@ void InlineAsm_InitializeRegistersPPC(void) {
sprintf(buf, "{?}%" PRId32, asmreg->num);
break;
}
- PPCError_Warning(100, obj->name->name, buf);
+ PPCError_Warning(PPCErrorStr100, obj->name->name, buf);
}
}
diff --git a/compiler_and_linker/unsorted/Intrinsics.c b/compiler_and_linker/unsorted/Intrinsics.c
index 59d3a24..49334b8 100644
--- a/compiler_and_linker/unsorted/Intrinsics.c
+++ b/compiler_and_linker/unsorted/Intrinsics.c
@@ -2412,17 +2412,17 @@ static SInt32 checkconstintarg(ENode *expr, char *name, SInt32 min, SInt32 max,
SInt32 value;
if (!ENODE_IS(expr, EINTCONST))
- PPCError_ErrorTerm(210, name, 3, max, argnum);
+ PPCError_ErrorTerm(PPCErrorStr210, name, 3, max, argnum);
value = CInt64_GetULong(&expr->data.intval);
if (value < min) {
- PPCError_Warning(211, name, argnum, value, min, max, min);
+ PPCError_Warning(PPCErrorStr211, name, argnum, value, min, max, min);
return min;
}
if (value > max) {
- PPCError_Warning(211, name, argnum, value, min, max, value & max);
+ PPCError_Warning(PPCErrorStr211, name, argnum, value, min, max, value & max);
value = value & max;
}
@@ -2535,7 +2535,7 @@ static int Intrinsics_VerifyParameterCount(int wantedCount, ENodeList *args, Has
count++;
if (count != wantedCount) {
- PPCError_Error(103, name->name, count, wantedCount);
+ PPCError_Error(PPCErrorStr103, name->name, count, wantedCount);
return 0;
}
@@ -2589,7 +2589,7 @@ static Type *Intrinsics_Verify1VectorArg2Ops(Intrinsics id, ENodeList *args, Has
rtype = table->rtype;
if (!rtype) {
- PPCError_Error(104, name->name, name->name, arg1->rtype, 0);
+ PPCError_Error(PPCErrorStr104, name->name, name->name, arg1->rtype, 0);
rtype = NULL;
}
return rtype;
@@ -2633,11 +2633,11 @@ static Type *Intrinsics_Verify1VectorArg(Intrinsics id, ENodeList *args, HashNam
if (ENODE_IS(arg1, EINTCONST)) {
SInt32 val = arg1->data.intval.lo;
if (val > 15 || val < -16) {
- PPCError_Error(108, name->name, name->name, 5);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 5);
return NULL;
}
} else {
- PPCError_Error(108, name->name, name->name, 5);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 5);
return NULL;
}
break;
@@ -2645,11 +2645,11 @@ static Type *Intrinsics_Verify1VectorArg(Intrinsics id, ENodeList *args, HashNam
if (ENODE_IS(arg1, EINTCONST)) {
SInt32 val = arg1->data.intval.lo;
if (val > 3 || val < 0) {
- PPCError_Error(108, name->name, name->name, 2);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 2);
return NULL;
}
} else {
- PPCError_Error(108, name->name, name->name, 2);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 2);
return NULL;
}
break;
@@ -2657,7 +2657,7 @@ static Type *Intrinsics_Verify1VectorArg(Intrinsics id, ENodeList *args, HashNam
rtype = table->rtype;
if (!rtype) {
- PPCError_Error(104, name->name, name->name, arg1->rtype, 0);
+ PPCError_Error(PPCErrorStr104, name->name, name->name, arg1->rtype, 0);
rtype = NULL;
}
return rtype;
@@ -2690,11 +2690,11 @@ static Type *Intrinsics_Verify2VectorArgs(Intrinsics id, ENodeList *args, HashNa
case Intrinsic_268:
if (ENODE_IS(arg2, EINTCONST)) {
if (arg2->data.intval.lo > 31 || arg2->data.intval.hi < 0) {
- PPCError_Error(108, name->name, name->name, 5);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 5);
return NULL;
}
} else {
- PPCError_Error(108, name->name, name->name, 5);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 5);
return NULL;
}
break;
@@ -2719,7 +2719,7 @@ static Type *Intrinsics_Verify2VectorArgs(Intrinsics id, ENodeList *args, HashNa
}
if (!table->rtype) {
- PPCError_Error(105, name->name, name->name, arg1->rtype, 0, arg2->rtype, 0);
+ PPCError_Error(PPCErrorStr105, name->name, name->name, arg1->rtype, 0, arg2->rtype, 0);
return NULL;
}
@@ -2728,7 +2728,7 @@ static Type *Intrinsics_Verify2VectorArgs(Intrinsics id, ENodeList *args, HashNa
case Intrinsic_067:
case Intrinsic_068:
if (arg2->flags & ENODE_FLAG_VOLATILE)
- PPCError_Warning(178, name->name);
+ PPCError_Warning(PPCErrorStr178, name->name);
}
return table->rtype;
@@ -2783,11 +2783,11 @@ static Type *Intrinsics_Verify3VectorArgs(Intrinsics id, ENodeList *args, HashNa
if (ENODE_IS(arg3, EINTCONST)) {
SInt32 val = arg3->data.intval.lo;
if (val > 3 || val < 0) {
- PPCError_Error(108, name->name, name->name, 2);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 2);
return NULL;
}
} else {
- PPCError_Error(108, name->name, name->name, 2);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 2);
return NULL;
}
break;
@@ -2795,18 +2795,18 @@ static Type *Intrinsics_Verify3VectorArgs(Intrinsics id, ENodeList *args, HashNa
case Intrinsic_263:
if (ENODE_IS(arg3, EINTCONST)) {
if (arg3->data.intval.lo > 15 || arg3->data.intval.hi < 0) {
- PPCError_Error(108, name->name, name->name, 4);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 4);
return NULL;
}
} else {
- PPCError_Error(108, name->name, name->name, 4);
+ PPCError_Error(PPCErrorStr108, name->name, name->name, 4);
return NULL;
}
break;
}
if (!table->rtype) {
- PPCError_Error(106, name->name, name->name, arg1->rtype, 0, arg2->rtype, 0, arg3->rtype, 0);
+ PPCError_Error(PPCErrorStr106, name->name, name->name, arg1->rtype, 0, arg2->rtype, 0, arg3->rtype, 0);
return NULL;
}
@@ -2815,7 +2815,7 @@ static Type *Intrinsics_Verify3VectorArgs(Intrinsics id, ENodeList *args, HashNa
case Intrinsic_115:
case Intrinsic_116:
if (arg3->flags & ENODE_FLAG_VOLATILE)
- PPCError_Warning(178, name->name);
+ PPCError_Warning(PPCErrorStr178, name->name);
}
return table->rtype;
diff --git a/compiler_and_linker/unsorted/PCodeAssembly.c b/compiler_and_linker/unsorted/PCodeAssembly.c
index 58a3d51..368f8c5 100644
--- a/compiler_and_linker/unsorted/PCodeAssembly.c
+++ b/compiler_and_linker/unsorted/PCodeAssembly.c
@@ -79,9 +79,9 @@ static SInt32 pcode_update_mem_labeldiff_imm(PCode *instr, const PCodeArg *op, W
offset = -offset;
if (offset > 0x7FFF)
- PPCError_Error(109);
+ PPCError_Error(PPCErrorStr109);
else if (offset < -0x8000)
- PPCError_Error(109);
+ PPCError_Error(PPCErrorStr109);
} else if (op->kind == PCOp_IMMEDIATE) {
offset = op->data.imm.value;
} else {
@@ -1546,7 +1546,7 @@ SInt32 assemblefunction(Object *func, EntryPoint *entrypoints) {
codesize = pccomputeoffsets();
if (codesize <= 0)
- PPCError_Error(190, func->name->name);
+ PPCError_Error(PPCErrorStr190, func->name->name);
if (copts.peephole || copts.optimizationlevel >= 3)
codesize = optimizefinalbranches(codesize);
diff --git a/compiler_and_linker/unsorted/PPCError.c b/compiler_and_linker/unsorted/PPCError.c
index 7b87e05..2d4c469 100644
--- a/compiler_and_linker/unsorted/PPCError.c
+++ b/compiler_and_linker/unsorted/PPCError.c
@@ -8,7 +8,7 @@ static void PPCError_GetErrorString(char *str, short code) {
short scode;
scode = (short) code;
- CError_ASSERT(40, scode >= 100 && scode < 212);
+ CError_ASSERT(40, scode >= 100 && scode < PPCErrorStrMAX);
COS_GetString(str, 10001, scode - 99);
}
diff --git a/compiler_and_linker/unsorted/TOC.c b/compiler_and_linker/unsorted/TOC.c
index a40eadd..7af09e3 100644
--- a/compiler_and_linker/unsorted/TOC.c
+++ b/compiler_and_linker/unsorted/TOC.c
@@ -1982,7 +1982,7 @@ static void expandTOCexpression(ENode *expr, Type *type, int ignored) {
}
if (IS_TYPE_VECTOR(expr->rtype) && !IS_TYPE_VECTOR(tmpexpr->rtype))
- PPCError_Error(114);
+ PPCError_Error(PPCErrorStr114);
break;
case EPOSTINC: