| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "courgette/adjustment_method.h" | 5 #include "courgette/adjustment_method.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 | 679 |
| 680 | 680 |
| 681 //////////////////////////////////////////////////////////////////////////////// | 681 //////////////////////////////////////////////////////////////////////////////// |
| 682 | 682 |
| 683 void AdjustmentMethod::Destroy() { delete this; } | 683 void AdjustmentMethod::Destroy() { delete this; } |
| 684 | 684 |
| 685 AdjustmentMethod* AdjustmentMethod::MakeNullAdjustmentMethod() { | 685 AdjustmentMethod* AdjustmentMethod::MakeNullAdjustmentMethod() { |
| 686 return new NullAdjustmentMethod(); | 686 return new NullAdjustmentMethod(); |
| 687 } | 687 } |
| 688 | 688 |
| 689 AdjustmentMethod* AdjustmentMethod::MakeProductionAdjustmentMethod() { | 689 AdjustmentMethod* AdjustmentMethod::MakeTrieAdjustmentMethod() { |
| 690 return new GraphAdjuster(); | 690 return new GraphAdjuster(); |
| 691 } | 691 } |
| 692 | 692 |
| 693 Status Adjust(const AssemblyProgram& model, AssemblyProgram* program) { | 693 Status Adjust(const AssemblyProgram& model, AssemblyProgram* program) { |
| 694 AdjustmentMethod* method = AdjustmentMethod::MakeProductionAdjustmentMethod(); | 694 AdjustmentMethod* method = AdjustmentMethod::MakeProductionAdjustmentMethod(); |
| 695 bool ok = method->Adjust(model, program); | 695 bool ok = method->Adjust(model, program); |
| 696 method->Destroy(); | 696 method->Destroy(); |
| 697 if (ok) | 697 if (ok) |
| 698 return C_OK; | 698 return C_OK; |
| 699 else | 699 else |
| 700 return C_ADJUSTMENT_FAILED; | 700 return C_ADJUSTMENT_FAILED; |
| 701 } | 701 } |
| 702 | 702 |
| 703 } // namespace courgette | 703 } // namespace courgette |
| OLD | NEW |