| 210 | return dir; |
| 211 | } |
| 212 | |
| 213 | bool is_codegen_option(unsigned id) { |
| 214 | /// Debug info options form a group (-g, -gdwarf-*, -gsplit-dwarf, etc.). |
| 215 | if(auto opt = option::table().option(id); opt && opt->matches(OPT_DebugInfo_Group)) { |
| 216 | return true; |
| 217 | } |
| 218 | |
| 219 | switch(id) { |
| 220 | /// Position-independent code — pure codegen, no macro or semantic effect. |
| 221 | case OPT_fPIC: |
| 222 | case OPT_fno_PIC: |
| 223 | case OPT_fpic: |
| 224 | case OPT_fno_pic: |
| 225 | case OPT_fPIE: |
| 226 | case OPT_fno_PIE: |
| 227 | case OPT_fpie: |
| 228 | case OPT_fno_pie: |
| 229 | |
| 230 | /// Frame pointer and unwind tables — pure codegen. |
| 231 | case OPT_mframe_pointer_EQ: |
| 232 | case OPT_fomit_frame_pointer: |
| 233 | case OPT_fno_omit_frame_pointer: |
| 234 | case OPT_funwind_tables: |
| 235 | case OPT_fno_unwind_tables: |
| 236 | case OPT_fasynchronous_unwind_tables: |
| 237 | case OPT_fno_asynchronous_unwind_tables: |
| 238 | |
| 239 | /// Stack protection — pure codegen. |
| 240 | case OPT_fstack_protector: |
| 241 | case OPT_fstack_protector_strong: |
| 242 | case OPT_fstack_protector_all: |
| 243 | case OPT_fno_stack_protector: |
| 244 | |
| 245 | /// Section splitting, LTO, semantic interposition — pure codegen/linker. |
| 246 | case OPT_fdata_sections: |
| 247 | case OPT_fno_data_sections: |
| 248 | case OPT_ffunction_sections: |
| 249 | case OPT_fno_function_sections: |
| 250 | case OPT_flto: |
| 251 | case OPT_flto_EQ: |
| 252 | case OPT_fno_lto: |
| 253 | case OPT_fsemantic_interposition: |
| 254 | case OPT_fno_semantic_interposition: |
| 255 | case OPT_fvisibility_inlines_hidden: |
| 256 | |
| 257 | /// Diagnostics output formatting — doesn't affect analysis. |
| 258 | case OPT_fcolor_diagnostics: |
| 259 | case OPT_fno_color_diagnostics: |
| 260 | |
| 261 | /// Floating-point codegen — doesn't define macros (unlike -ffast-math). |
| 262 | case OPT_ftrapping_math: |
| 263 | case OPT_fno_trapping_math: return true; |
| 264 | |
| 265 | default: return false; |
| 266 | } |
| 267 | } |
| 268 |
no outgoing calls
no test coverage detected