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

Side by Side Diff: src/flags.cc

Issue 3082: Rename flags.defs to flag-definitions.h.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/flags.h ('k') | src/flags.defs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 18 matching lines...) Expand all
29 #include <stdlib.h> 29 #include <stdlib.h>
30 30
31 #include "v8.h" 31 #include "v8.h"
32 32
33 #include "platform.h" 33 #include "platform.h"
34 34
35 namespace v8 { namespace internal { 35 namespace v8 { namespace internal {
36 36
37 // Define all of our flags. 37 // Define all of our flags.
38 #define FLAG_MODE_DEFINE 38 #define FLAG_MODE_DEFINE
39 #include "flags.defs" 39 #include "flag-definitions.h"
40 40
41 // Define all of our flags default values. 41 // Define all of our flags default values.
42 #define FLAG_MODE_DEFINE_DEFAULTS 42 #define FLAG_MODE_DEFINE_DEFAULTS
43 #include "flags.defs" 43 #include "flag-definitions.h"
44 44
45 namespace { 45 namespace {
46 46
47 // This structure represents a single entry in the flag system, with a pointer 47 // This structure represents a single entry in the flag system, with a pointer
48 // to the actual flag, default value, comment, etc. This is designed to be POD 48 // to the actual flag, default value, comment, etc. This is designed to be POD
49 // initialized as to avoid requiring static constructors. 49 // initialized as to avoid requiring static constructors.
50 struct Flag { 50 struct Flag {
51 enum FlagType { TYPE_BOOL, TYPE_INT, TYPE_FLOAT, TYPE_STRING }; 51 enum FlagType { TYPE_BOOL, TYPE_INT, TYPE_FLOAT, TYPE_STRING };
52 52
53 FlagType type_; // What type of flag, bool, int, or string. 53 FlagType type_; // What type of flag, bool, int, or string.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 break; 136 break;
137 case TYPE_STRING: 137 case TYPE_STRING:
138 *string_variable() = string_default(); 138 *string_variable() = string_default();
139 break; 139 break;
140 } 140 }
141 } 141 }
142 }; 142 };
143 143
144 Flag flags[] = { 144 Flag flags[] = {
145 #define FLAG_MODE_META 145 #define FLAG_MODE_META
146 #include "flags.defs" 146 #include "flag-definitions.h"
147 }; 147 };
148 148
149 const size_t num_flags = sizeof(flags) / sizeof(*flags); 149 const size_t num_flags = sizeof(flags) / sizeof(*flags);
150 150
151 } // namespace 151 } // namespace
152 152
153 153
154 static const char* Type2String(Flag::FlagType type) { 154 static const char* Type2String(Flag::FlagType type) {
155 switch (type) { 155 switch (type) {
156 case Flag::TYPE_BOOL: return "bool"; 156 case Flag::TYPE_BOOL: return "bool";
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 for (size_t i = 0; i < num_flags; ++i) { 450 for (size_t i = 0; i < num_flags; ++i) {
451 Flag* f = &flags[i]; 451 Flag* f = &flags[i];
452 char* value = ToString(f); 452 char* value = ToString(f);
453 printf(" --%s (%s) type: %s default: %s\n", 453 printf(" --%s (%s) type: %s default: %s\n",
454 f->name(), f->comment(), Type2String(f->type()), value); 454 f->name(), f->comment(), Type2String(f->type()), value);
455 DeleteArray(value); 455 DeleteArray(value);
456 } 456 }
457 } 457 }
458 458
459 } } // namespace v8::internal 459 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flags.h ('k') | src/flags.defs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698