Mercurial > hg > CbC > CbC_gcc
comparison gcc/opt-functions.awk @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
1 # Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc. | 1 # Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010 |
2 # Free Software Foundation, Inc. | |
2 # Contributed by Kelley Cook, June 2004. | 3 # Contributed by Kelley Cook, June 2004. |
3 # Original code from Neil Booth, May 2003. | 4 # Original code from Neil Booth, May 2003. |
4 # | 5 # |
5 # This program is free software; you can redistribute it and/or modify it | 6 # This program is free software; you can redistribute it and/or modify it |
6 # under the terms of the GNU General Public License as published by the | 7 # under the terms of the GNU General Public License as published by the |
134 else | 135 else |
135 return "const char *" | 136 return "const char *" |
136 } | 137 } |
137 | 138 |
138 # Return the type of variable that should be associated with the given flags | 139 # Return the type of variable that should be associated with the given flags |
139 # for use within a structure. Simple variables are changed to unsigned char | 140 # for use within a structure. Simple variables are changed to signed char |
140 # type instead of int to save space. | 141 # type instead of int to save space. |
141 function var_type_struct(flags) | 142 function var_type_struct(flags) |
142 { | 143 { |
143 if (flag_set_p("UInteger", flags)) | 144 if (flag_set_p("UInteger", flags)) |
144 return "int " | 145 return "int " |
145 else if (!flag_set_p("Joined.*", flags)) { | 146 else if (!flag_set_p("Joined.*", flags)) { |
146 if (flag_set_p(".*Mask.*", flags)) | 147 if (flag_set_p(".*Mask.*", flags)) |
147 return "int " | 148 return "int " |
148 else | 149 else |
149 return "unsigned char " | 150 return "signed char " |
150 } | 151 } |
151 else | 152 else |
152 return "const char *" | 153 return "const char *" |
153 } | 154 } |
154 | 155 |
191 return "&target_flags" | 192 return "&target_flags" |
192 if (opt_args("InverseMask", flags) != "") | 193 if (opt_args("InverseMask", flags) != "") |
193 return "&target_flags" | 194 return "&target_flags" |
194 return "0" | 195 return "0" |
195 } | 196 } |
197 | |
198 # Given the option called NAME return a sanitized version of its name. | |
199 function opt_sanitized_name(name) | |
200 { | |
201 if (name == "finline-limit=" || name == "Wlarger-than=" \ | |
202 || name == "ftemplate-depth=") | |
203 name = name "eq" | |
204 if (name == "gdwarf+") | |
205 name = "gdwarfplus" | |
206 gsub ("[^A-Za-z0-9]", "_", name) | |
207 return name | |
208 } | |
209 | |
210 # Given the option called NAME return the appropriate enum for it. | |
211 function opt_enum(name) | |
212 { | |
213 return "OPT_" opt_sanitized_name(name) | |
214 } |