MCPcopy Create free account
hub / github.com/GJDuck/e9patch / sendOperandDataMetadata

Function sendOperandDataMetadata

src/e9tool/e9metadata.cpp:1077–1109  ·  view source on GitHub ↗

* Emits operand data. */

Source from the content-addressed store, hash-verified

1075 * Emits operand data.
1076 */
1077static void sendOperandDataMetadata(FILE *out, const char *name,
1078 const InstrInfo *I, const OpInfo *op, int regno)
1079{
1080 if (op == nullptr)
1081 return;
1082
1083 switch (op->type)
1084 {
1085 case OPTYPE_IMM:
1086 fprintf(out, "\".Limm%d@%s\",", regno, name);
1087 switch (op->size)
1088 {
1089 case 1:
1090 fprintf(out, "{\"int8\":%d},", (int32_t)op->imm);
1091 break;
1092 case 2:
1093 fprintf(out, "{\"int16\":%d},", (uint32_t)op->imm);
1094 break;
1095 case 4:
1096 fprintf(out, "{\"int32\":%d},", (uint32_t)op->imm);
1097 break;
1098 default:
1099 fputs("{\"int64\":", out),
1100 sendInteger(out, op->imm);
1101 fputs("},", out);
1102 break;
1103 }
1104 break;
1105
1106 default:
1107 return;
1108 }
1109}
1110
1111/*
1112 * Emits instructions to translate to/from static and dynamic addresses.

Callers 1

sendArgumentDataMetadataFunction · 0.85

Calls 2

fputsFunction · 0.85
fprintfFunction · 0.50

Tested by

no test coverage detected