Mercurial > hg > truffle
comparison src/share/vm/adlc/output_c.cpp @ 14459:194e8b7fe9ca
8033168: PPC64: gcc 4.8 warning in output_c.cpp
Summary: fix warnings
Reviewed-by: kvn
author | goetz |
---|---|
date | Thu, 30 Jan 2014 14:30:01 +0100 |
parents | abec000618bf |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14458:0c521b3f32dd | 14459:194e8b7fe9ca |
---|---|
2500 | 2500 |
2501 // (3) and (4) | 2501 // (3) and (4) |
2502 fprintf(fp,"}\n\n"); | 2502 fprintf(fp,"}\n\n"); |
2503 } | 2503 } |
2504 | 2504 |
2505 // Emit late expand function. | 2505 // Emit postalloc expand function. |
2506 void ArchDesc::define_postalloc_expand(FILE *fp, InstructForm &inst) { | 2506 void ArchDesc::define_postalloc_expand(FILE *fp, InstructForm &inst) { |
2507 InsEncode *ins_encode = inst._insencode; | 2507 InsEncode *ins_encode = inst._insencode; |
2508 | 2508 |
2509 // Output instruction's postalloc_expand prototype. | 2509 // Output instruction's postalloc_expand prototype. |
2510 fprintf(fp, "void %sNode::postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_) {\n", | 2510 fprintf(fp, "void %sNode::postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_) {\n", |
2517 | 2517 |
2518 // Output variables "unsigned idx_<par_name>", Node *n_<par_name> and "MachOpnd *op_<par_name>" | 2518 // Output variables "unsigned idx_<par_name>", Node *n_<par_name> and "MachOpnd *op_<par_name>" |
2519 // for each parameter <par_name> specified in the encoding. | 2519 // for each parameter <par_name> specified in the encoding. |
2520 ins_encode->reset(); | 2520 ins_encode->reset(); |
2521 const char *ec_name = ins_encode->encode_class_iter(); | 2521 const char *ec_name = ins_encode->encode_class_iter(); |
2522 assert(ec_name != NULL, "late expand must specify an encoding"); | 2522 assert(ec_name != NULL, "Postalloc expand must specify an encoding."); |
2523 | 2523 |
2524 EncClass *encoding = _encode->encClass(ec_name); | 2524 EncClass *encoding = _encode->encClass(ec_name); |
2525 if (encoding == NULL) { | 2525 if (encoding == NULL) { |
2526 fprintf(stderr, "User did not define contents of this encode_class: %s\n", ec_name); | 2526 fprintf(stderr, "User did not define contents of this encode_class: %s\n", ec_name); |
2527 abort(); | 2527 abort(); |
2530 globalAD->syntax_err(ins_encode->_linenum, "In %s: passing %d arguments to %s but expecting %d", | 2530 globalAD->syntax_err(ins_encode->_linenum, "In %s: passing %d arguments to %s but expecting %d", |
2531 inst._ident, ins_encode->current_encoding_num_args(), | 2531 inst._ident, ins_encode->current_encoding_num_args(), |
2532 ec_name, encoding->num_args()); | 2532 ec_name, encoding->num_args()); |
2533 } | 2533 } |
2534 | 2534 |
2535 fprintf(fp, " // Access to ins and operands for late expand.\n"); | 2535 fprintf(fp, " // Access to ins and operands for postalloc expand.\n"); |
2536 const int buflen = 2000; | 2536 const int buflen = 2000; |
2537 char idxbuf[buflen]; char *ib = idxbuf; sprintf(ib, ""); | 2537 char idxbuf[buflen]; char *ib = idxbuf; idxbuf[0] = '\0'; |
2538 char nbuf [buflen]; char *nb = nbuf; sprintf(nb, ""); | 2538 char nbuf [buflen]; char *nb = nbuf; nbuf[0] = '\0'; |
2539 char opbuf [buflen]; char *ob = opbuf; sprintf(ob, ""); | 2539 char opbuf [buflen]; char *ob = opbuf; opbuf[0] = '\0'; |
2540 | 2540 |
2541 encoding->_parameter_type.reset(); | 2541 encoding->_parameter_type.reset(); |
2542 encoding->_parameter_name.reset(); | 2542 encoding->_parameter_name.reset(); |
2543 const char *type = encoding->_parameter_type.iter(); | 2543 const char *type = encoding->_parameter_type.iter(); |
2544 const char *name = encoding->_parameter_name.iter(); | 2544 const char *name = encoding->_parameter_name.iter(); |
2552 name, type, arg_name); | 2552 name, type, arg_name); |
2553 nb += sprintf(nb, " Node *n_%-7s = lookup(idx_%s);\n", name, name); | 2553 nb += sprintf(nb, " Node *n_%-7s = lookup(idx_%s);\n", name, name); |
2554 // There is no operand for the constanttablebase. | 2554 // There is no operand for the constanttablebase. |
2555 } else if (inst.is_noninput_operand(idx)) { | 2555 } else if (inst.is_noninput_operand(idx)) { |
2556 globalAD->syntax_err(inst._linenum, | 2556 globalAD->syntax_err(inst._linenum, |
2557 "In %s: you can not pass the non-input %s to a late expand encoding.\n", | 2557 "In %s: you can not pass the non-input %s to a postalloc expand encoding.\n", |
2558 inst._ident, arg_name); | 2558 inst._ident, arg_name); |
2559 } else { | 2559 } else { |
2560 ib += sprintf(ib, " unsigned idx_%-5s = idx%d; \t// %s, \t%s\n", | 2560 ib += sprintf(ib, " unsigned idx_%-5s = idx%d; \t// %s, \t%s\n", |
2561 name, idx, type, arg_name); | 2561 name, idx, type, arg_name); |
2562 nb += sprintf(nb, " Node *n_%-7s = lookup(idx_%s);\n", name, name); | 2562 nb += sprintf(nb, " Node *n_%-7s = lookup(idx_%s);\n", name, name); |
2603 fprintf(fp, " }\n"); | 2603 fprintf(fp, " }\n"); |
2604 | 2604 |
2605 fprintf(fp, "}\n\n"); | 2605 fprintf(fp, "}\n\n"); |
2606 | 2606 |
2607 ec_name = ins_encode->encode_class_iter(); | 2607 ec_name = ins_encode->encode_class_iter(); |
2608 assert(ec_name == NULL, "Late expand may only have one encoding."); | 2608 assert(ec_name == NULL, "Postalloc expand may only have one encoding."); |
2609 } | 2609 } |
2610 | 2610 |
2611 // defineEmit ----------------------------------------------------------------- | 2611 // defineEmit ----------------------------------------------------------------- |
2612 void ArchDesc::defineEmit(FILE* fp, InstructForm& inst) { | 2612 void ArchDesc::defineEmit(FILE* fp, InstructForm& inst) { |
2613 InsEncode* encode = inst._insencode; | 2613 InsEncode* encode = inst._insencode; |