@@ -323,84 +323,69 @@ void Preprocessor::dumpMacroInfo(const IdentifierInfo *II) {
323
323
}
324
324
}
325
325
326
- // / RegisterBuiltinMacro - Register the specified identifier in the identifier
327
- // / table and mark it as a builtin macro to be expanded.
328
- static IdentifierInfo *RegisterBuiltinMacro (Preprocessor &PP, const char *Name){
329
- // Get the identifier.
330
- IdentifierInfo *Id = PP.getIdentifierInfo (Name);
331
-
332
- // Mark it as being a macro that is builtin.
333
- MacroInfo *MI = PP.AllocateMacroInfo (SourceLocation ());
334
- MI->setIsBuiltinMacro ();
335
- PP.appendDefMacroDirective (Id, MI);
336
- return Id;
337
- }
338
-
339
326
// / RegisterBuiltinMacros - Register builtin macros, such as __LINE__ with the
340
327
// / identifier table.
341
328
void Preprocessor::RegisterBuiltinMacros () {
342
- Ident__LINE__ = RegisterBuiltinMacro (* this , " __LINE__" );
343
- Ident__FILE__ = RegisterBuiltinMacro (* this , " __FILE__" );
344
- Ident__DATE__ = RegisterBuiltinMacro (* this , " __DATE__" );
345
- Ident__TIME__ = RegisterBuiltinMacro (* this , " __TIME__" );
346
- Ident__COUNTER__ = RegisterBuiltinMacro (* this , " __COUNTER__" );
347
- Ident_Pragma = RegisterBuiltinMacro (* this , " _Pragma" );
348
- Ident__FLT_EVAL_METHOD__ = RegisterBuiltinMacro (* this , " __FLT_EVAL_METHOD__" );
329
+ Ident__LINE__ = RegisterBuiltinMacro (" __LINE__" );
330
+ Ident__FILE__ = RegisterBuiltinMacro (" __FILE__" );
331
+ Ident__DATE__ = RegisterBuiltinMacro (" __DATE__" );
332
+ Ident__TIME__ = RegisterBuiltinMacro (" __TIME__" );
333
+ Ident__COUNTER__ = RegisterBuiltinMacro (" __COUNTER__" );
334
+ Ident_Pragma = RegisterBuiltinMacro (" _Pragma" );
335
+ Ident__FLT_EVAL_METHOD__ = RegisterBuiltinMacro (" __FLT_EVAL_METHOD__" );
349
336
350
337
// C++ Standing Document Extensions.
351
338
if (getLangOpts ().CPlusPlus )
352
- Ident__has_cpp_attribute =
353
- RegisterBuiltinMacro (*this , " __has_cpp_attribute" );
339
+ Ident__has_cpp_attribute = RegisterBuiltinMacro (" __has_cpp_attribute" );
354
340
else
355
341
Ident__has_cpp_attribute = nullptr ;
356
342
357
343
// GCC Extensions.
358
- Ident__BASE_FILE__ = RegisterBuiltinMacro (* this , " __BASE_FILE__" );
359
- Ident__INCLUDE_LEVEL__ = RegisterBuiltinMacro (* this , " __INCLUDE_LEVEL__" );
360
- Ident__TIMESTAMP__ = RegisterBuiltinMacro (* this , " __TIMESTAMP__" );
344
+ Ident__BASE_FILE__ = RegisterBuiltinMacro (" __BASE_FILE__" );
345
+ Ident__INCLUDE_LEVEL__ = RegisterBuiltinMacro (" __INCLUDE_LEVEL__" );
346
+ Ident__TIMESTAMP__ = RegisterBuiltinMacro (" __TIMESTAMP__" );
361
347
362
348
// Microsoft Extensions.
363
349
if (getLangOpts ().MicrosoftExt ) {
364
- Ident__identifier = RegisterBuiltinMacro (* this , " __identifier" );
365
- Ident__pragma = RegisterBuiltinMacro (* this , " __pragma" );
350
+ Ident__identifier = RegisterBuiltinMacro (" __identifier" );
351
+ Ident__pragma = RegisterBuiltinMacro (" __pragma" );
366
352
} else {
367
353
Ident__identifier = nullptr ;
368
354
Ident__pragma = nullptr ;
369
355
}
370
356
371
357
// Clang Extensions.
372
- Ident__FILE_NAME__ = RegisterBuiltinMacro (* this , " __FILE_NAME__" );
373
- Ident__has_feature = RegisterBuiltinMacro (* this , " __has_feature" );
374
- Ident__has_extension = RegisterBuiltinMacro (* this , " __has_extension" );
375
- Ident__has_builtin = RegisterBuiltinMacro (* this , " __has_builtin" );
358
+ Ident__FILE_NAME__ = RegisterBuiltinMacro (" __FILE_NAME__" );
359
+ Ident__has_feature = RegisterBuiltinMacro (" __has_feature" );
360
+ Ident__has_extension = RegisterBuiltinMacro (" __has_extension" );
361
+ Ident__has_builtin = RegisterBuiltinMacro (" __has_builtin" );
376
362
Ident__has_constexpr_builtin =
377
- RegisterBuiltinMacro (* this , " __has_constexpr_builtin" );
378
- Ident__has_attribute = RegisterBuiltinMacro (* this , " __has_attribute" );
363
+ RegisterBuiltinMacro (" __has_constexpr_builtin" );
364
+ Ident__has_attribute = RegisterBuiltinMacro (" __has_attribute" );
379
365
if (!getLangOpts ().CPlusPlus )
380
- Ident__has_c_attribute = RegisterBuiltinMacro (* this , " __has_c_attribute" );
366
+ Ident__has_c_attribute = RegisterBuiltinMacro (" __has_c_attribute" );
381
367
else
382
368
Ident__has_c_attribute = nullptr ;
383
369
384
- Ident__has_declspec = RegisterBuiltinMacro (* this , " __has_declspec_attribute" );
385
- Ident__has_embed = RegisterBuiltinMacro (* this , " __has_embed" );
386
- Ident__has_include = RegisterBuiltinMacro (* this , " __has_include" );
387
- Ident__has_include_next = RegisterBuiltinMacro (* this , " __has_include_next" );
388
- Ident__has_warning = RegisterBuiltinMacro (* this , " __has_warning" );
389
- Ident__is_identifier = RegisterBuiltinMacro (* this , " __is_identifier" );
390
- Ident__is_target_arch = RegisterBuiltinMacro (* this , " __is_target_arch" );
391
- Ident__is_target_vendor = RegisterBuiltinMacro (* this , " __is_target_vendor" );
392
- Ident__is_target_os = RegisterBuiltinMacro (* this , " __is_target_os" );
370
+ Ident__has_declspec = RegisterBuiltinMacro (" __has_declspec_attribute" );
371
+ Ident__has_embed = RegisterBuiltinMacro (" __has_embed" );
372
+ Ident__has_include = RegisterBuiltinMacro (" __has_include" );
373
+ Ident__has_include_next = RegisterBuiltinMacro (" __has_include_next" );
374
+ Ident__has_warning = RegisterBuiltinMacro (" __has_warning" );
375
+ Ident__is_identifier = RegisterBuiltinMacro (" __is_identifier" );
376
+ Ident__is_target_arch = RegisterBuiltinMacro (" __is_target_arch" );
377
+ Ident__is_target_vendor = RegisterBuiltinMacro (" __is_target_vendor" );
378
+ Ident__is_target_os = RegisterBuiltinMacro (" __is_target_os" );
393
379
Ident__is_target_environment =
394
- RegisterBuiltinMacro (*this , " __is_target_environment" );
395
- Ident__is_target_variant_os =
396
- RegisterBuiltinMacro (*this , " __is_target_variant_os" );
380
+ RegisterBuiltinMacro (" __is_target_environment" );
381
+ Ident__is_target_variant_os = RegisterBuiltinMacro (" __is_target_variant_os" );
397
382
Ident__is_target_variant_environment =
398
- RegisterBuiltinMacro (* this , " __is_target_variant_environment" );
383
+ RegisterBuiltinMacro (" __is_target_variant_environment" );
399
384
400
385
// Modules.
401
- Ident__building_module = RegisterBuiltinMacro (* this , " __building_module" );
386
+ Ident__building_module = RegisterBuiltinMacro (" __building_module" );
402
387
if (!getLangOpts ().CurrentModule .empty ())
403
- Ident__MODULE__ = RegisterBuiltinMacro (* this , " __MODULE__" );
388
+ Ident__MODULE__ = RegisterBuiltinMacro (" __MODULE__" );
404
389
else
405
390
Ident__MODULE__ = nullptr ;
406
391
}
0 commit comments