Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: courgette/ensemble_create.cc

Issue 7920004: Start refactoring to reduce executable type knowledge. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix windows compile warning. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/ensemble_apply.cc ('k') | courgette/win32_x86_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/ensemble_create.cc
diff --git a/courgette/ensemble_create.cc b/courgette/ensemble_create.cc
index ec33689dcd0e1facd808fa0fe82a57951c173c4a..62105b93e7dcbfab8f123bd5e44c3c17e577df3d 100644
--- a/courgette/ensemble_create.cc
+++ b/courgette/ensemble_create.cc
@@ -65,17 +65,21 @@ Status TransformationPatchGenerator::Reform(
// Element kind.
TransformationPatchGenerator* MakeGenerator(Element* old_element,
Element* new_element) {
- if (new_element->kind() == Element::WIN32_X86_WITH_CODE) {
- CourgetteWin32X86PatchGenerator* generator =
- new CourgetteWin32X86PatchGenerator(
- old_element,
- new_element,
- new CourgetteWin32X86Patcher(old_element->region()));
- return generator;
- } else {
- LOG(WARNING) << "Unexpected Element::Kind " << old_element->kind();
- return NULL;
+ switch (new_element->kind()) {
+ case UNKNOWN:
+ break;
+ case WIN32_X86: {
+ TransformationPatchGenerator* generator =
+ new CourgetteWin32X86PatchGenerator(
+ old_element,
+ new_element,
+ new CourgetteWin32X86Patcher(old_element->region()));
+ return generator;
+ }
}
+
+ LOG(WARNING) << "Unexpected Element::Kind " << old_element->kind();
+ return NULL;
}
// Checks to see if the proposed comparison is 'unsafe'. Sometimes one element
« no previous file with comments | « courgette/ensemble_apply.cc ('k') | courgette/win32_x86_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698