OLD | NEW |
1 //===--- MacroExpansion.cpp - Top level Macro Expansion -------------------===// | 1 //===--- MacroExpansion.cpp - Top level Macro Expansion -------------------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the top level handling of macro expasion for the | 10 // This file implements the top level handling of macro expasion for the |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 TIMELoc = TmpTok.getLocation(); | 576 TIMELoc = TmpTok.getLocation(); |
577 } | 577 } |
578 | 578 |
579 | 579 |
580 /// HasFeature - Return true if we recognize and implement the feature | 580 /// HasFeature - Return true if we recognize and implement the feature |
581 /// specified by the identifier as a standard language feature. | 581 /// specified by the identifier as a standard language feature. |
582 static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { | 582 static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { |
583 const LangOptions &LangOpts = PP.getLangOptions(); | 583 const LangOptions &LangOpts = PP.getLangOptions(); |
584 | 584 |
585 return llvm::StringSwitch<bool>(II->getName()) | 585 return llvm::StringSwitch<bool>(II->getName()) |
| 586 .Case("address_sanitizer", LangOpts.AddressSanitizer) |
586 .Case("attribute_analyzer_noreturn", true) | 587 .Case("attribute_analyzer_noreturn", true) |
587 .Case("attribute_availability", true) | 588 .Case("attribute_availability", true) |
588 .Case("attribute_cf_returns_not_retained", true) | 589 .Case("attribute_cf_returns_not_retained", true) |
589 .Case("attribute_cf_returns_retained", true) | 590 .Case("attribute_cf_returns_retained", true) |
590 .Case("attribute_deprecated_with_message", true) | 591 .Case("attribute_deprecated_with_message", true) |
591 .Case("attribute_ext_vector_type", true) | 592 .Case("attribute_ext_vector_type", true) |
592 .Case("attribute_ns_returns_not_retained", true) | 593 .Case("attribute_ns_returns_not_retained", true) |
593 .Case("attribute_ns_returns_retained", true) | 594 .Case("attribute_ns_returns_retained", true) |
594 .Case("attribute_ns_consumes_self", true) | 595 .Case("attribute_ns_consumes_self", true) |
595 .Case("attribute_ns_consumed", true) | 596 .Case("attribute_ns_consumed", true) |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 Tok.getLocation(), Tok.getLocation()); | 1104 Tok.getLocation(), Tok.getLocation()); |
1104 } | 1105 } |
1105 | 1106 |
1106 void Preprocessor::markMacroAsUsed(MacroInfo *MI) { | 1107 void Preprocessor::markMacroAsUsed(MacroInfo *MI) { |
1107 // If the 'used' status changed, and the macro requires 'unused' warning, | 1108 // If the 'used' status changed, and the macro requires 'unused' warning, |
1108 // remove its SourceLocation from the warn-for-unused-macro locations. | 1109 // remove its SourceLocation from the warn-for-unused-macro locations. |
1109 if (MI->isWarnIfUnused() && !MI->isUsed()) | 1110 if (MI->isWarnIfUnused() && !MI->isUsed()) |
1110 WarnUnusedMacroLocs.erase(MI->getDefinitionLoc()); | 1111 WarnUnusedMacroLocs.erase(MI->getDefinitionLoc()); |
1111 MI->setIsUsed(true); | 1112 MI->setIsUsed(true); |
1112 } | 1113 } |
OLD | NEW |