| 533 | } |
| 534 | |
| 535 | void |
| 536 | Probabilities::initialize_single_probs() |
| 537 | { |
| 538 | std::map<ProbName, int> m; |
| 539 | m[pMoreStructUnionProb] = 50; |
| 540 | m[pBitFieldsCreationProb] = 50; |
| 541 | m[pBitFieldInNormalStructProb] = 10; |
| 542 | m[pScalarFieldInFullBitFieldsProb] = 10; |
| 543 | m[pExhaustiveBitFieldsProb] = 10; |
| 544 | m[pBitFieldsSignedProb] = 50; |
| 545 | m[pSafeOpsSignedProb] = 50; |
| 546 | |
| 547 | if (CGOptions::volatiles()) |
| 548 | m[pRegularVolatileProb] = 50; |
| 549 | else |
| 550 | m[pRegularVolatileProb] = 0; |
| 551 | |
| 552 | if (CGOptions::consts()) |
| 553 | m[pRegularConstProb] = 10; |
| 554 | else |
| 555 | m[pRegularConstProb] = 0; |
| 556 | |
| 557 | if (CGOptions::consts()) |
| 558 | m[pStricterConstProb] = 50; |
| 559 | else |
| 560 | m[pStricterConstProb] = 0; |
| 561 | |
| 562 | if (CGOptions::consts()) |
| 563 | m[pLooserConstProb] = 50; |
| 564 | else |
| 565 | m[pLooserConstProb] = 0; |
| 566 | |
| 567 | if (CGOptions::volatiles() && |
| 568 | CGOptions::vol_struct_union_fields() && |
| 569 | CGOptions::global_variables()) |
| 570 | m[pFieldVolatileProb] = 30; |
| 571 | else |
| 572 | m[pFieldVolatileProb] = 0; |
| 573 | |
| 574 | if (CGOptions::consts() && CGOptions::const_struct_union_fields()) |
| 575 | m[pFieldConstProb] = 20; |
| 576 | else |
| 577 | m[pFieldConstProb] = 0; |
| 578 | |
| 579 | m[pStdUnaryFuncProb] = 5; |
| 580 | m[pShiftByNonConstantProb] = 50; |
| 581 | m[pStructAsLTypeProb] = 30; |
| 582 | m[pUnionAsLTypeProb] = 25; |
| 583 | if (CGOptions::enable_float()) |
| 584 | m[pFloatAsLTypeProb] = 40; |
| 585 | else |
| 586 | m[pFloatAsLTypeProb] = 0; |
| 587 | if (CGOptions::arrays()) |
| 588 | m[pNewArrayVariableProb] = 20; |
| 589 | else |
| 590 | m[pNewArrayVariableProb] = 0; |
| 591 | if (CGOptions::pointers()) { |
| 592 | m[pPointerAsLTypeProb] = 50; |