Lines Matching refs:II

62 Preprocessor::getLocalMacroDirectiveHistory(const IdentifierInfo *II) const {
63 if (!II->hadMacroDefinition())
65 auto Pos = CurSubmoduleState->Macros.find(II);
70 void Preprocessor::appendMacroDirective(IdentifierInfo *II, MacroDirective *MD){
74 MacroState &StoredMD = CurSubmoduleState->Macros[II];
78 StoredMD.overrideActiveModuleMacros(*this, II);
84 PendingModuleMacroNames.push_back(II);
88 II->setHasMacroDefinition(true);
89 if (!MD->isDefined() && LeafModuleMacros.find(II) == LeafModuleMacros.end())
90 II->setHasMacroDefinition(false);
91 if (II->isFromAST())
92 II->setChangedSinceDeserialization();
95 void Preprocessor::setLoadedMacroDirective(IdentifierInfo *II,
107 assert(II && MD);
108 MacroState &StoredMD = CurSubmoduleState->Macros[II];
126 II->setHasMacroDefinition(true);
127 if (!MD->isDefined() && LeafModuleMacros.find(II) == LeafModuleMacros.end())
128 II->setHasMacroDefinition(false);
131 ModuleMacro *Preprocessor::addModuleMacro(Module *Mod, IdentifierInfo *II,
136 ModuleMacro::Profile(ID, Mod, II);
144 auto *MM = ModuleMacro::create(*this, Mod, II, Macro, Overrides);
155 auto &LeafMacros = LeafModuleMacros[II];
167 II->setHasMacroDefinition(true);
173 ModuleMacro *Preprocessor::getModuleMacro(Module *Mod, IdentifierInfo *II) {
175 ModuleMacro::Profile(ID, Mod, II);
181 void Preprocessor::updateModuleMacroInfo(const IdentifierInfo *II,
189 auto Leaf = LeafModuleMacros.find(II);
259 void Preprocessor::dumpMacroInfo(const IdentifierInfo *II) {
261 auto LeafIt = LeafModuleMacros.find(II);
265 auto Pos = CurSubmoduleState->Macros.find(II);
269 llvm::errs() << "MacroState " << State << " " << II->getNameStart();
270 if (State && State->isAmbiguous(*this, II))
288 for (auto *MM : State ? State->getActiveModuleMacros(*this, II) : None)
403 IdentifierInfo *II = MI->getReplacementToken(0).getIdentifierInfo();
406 if (!II) return true;
410 if (II->isOutOfDate())
411 PP.getExternalSource()->updateOutOfDateIdentifier(*II);
415 if (auto *ExpansionMI = PP.getMacroInfo(II))
418 II != MacroIdent)
427 return std::find(MI->param_begin(), MI->param_end(), II) == MI->param_end();
1156 IdentifierInfo *II, Preprocessor &PP,
1165 PP.Diag(LParenLoc, diag::err_pp_directive_required) << II;
1168 Tok.setIdentifierInfo(II);
1182 PP.Diag(LParenLoc, diag::err_pp_expected_after) << II << tok::l_paren;
1214 << II << tok::r_paren;
1245 static bool EvaluateHasInclude(Token &Tok, IdentifierInfo *II,
1247 return EvaluateHasIncludeCommon(Tok, II, PP, nullptr, nullptr);
1253 IdentifierInfo *II, Preprocessor &PP) {
1281 return EvaluateHasIncludeCommon(Tok, II, PP, Lookup, LookupFromFile);
1287 Token &Tok, IdentifierInfo *II,
1295 PP.Diag(Tok.getLocation(), diag::err_pp_expected_after) << II
1337 PP.Diag(Tok.getLocation(), diag::err_pp_nested_paren) << II;
1396 IdentifierInfo *II;
1397 if (!Tok.isAnnotation() && (II = Tok.getIdentifierInfo()))
1398 return II;
1405 static bool isTargetArch(const TargetInfo &TI, const IdentifierInfo *II) {
1406 std::string ArchName = II->getName().lower() + "--";
1427 static bool isTargetVendor(const TargetInfo &TI, const IdentifierInfo *II) {
1431 return VendorName.equals_lower(II->getName());
1435 static bool isTargetOS(const TargetInfo &TI, const IdentifierInfo *II) {
1437 (llvm::Twine("unknown-unknown-") + II->getName().lower()).str();
1448 const IdentifierInfo *II) {
1449 std::string EnvName = (llvm::Twine("---") + II->getName().lower()).str();
1469 IdentifierInfo *II = Tok.getIdentifierInfo();
1470 assert(II && "Can't be a macro without id info!");
1474 if (II == Ident_Pragma)
1476 else if (II == Ident__pragma) // in non-MS mode this is null
1490 if (II == Ident__LINE__) {
1511 } else if (II == Ident__FILE__ || II == Ident__BASE_FILE__ ||
1512 II == Ident__FILE_NAME__) {
1519 if (II == Ident__BASE_FILE__ && PLoc.isValid()) {
1535 if (II == Ident__FILE_NAME__) {
1551 } else if (II == Ident__DATE__) {
1561 } else if (II == Ident__TIME__) {
1571 } else if (II == Ident__INCLUDE_LEVEL__) {
1586 } else if (II == Ident__TIMESTAMP__) {
1610 } else if (II == Ident__COUNTER__) {
1614 } else if (II == Ident__has_feature) {
1615 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1617 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1619 return II && HasFeature(*this, II->getName());
1621 } else if (II == Ident__has_extension) {
1622 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1624 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1626 return II && HasExtension(*this, II->getName());
1628 } else if (II == Ident__has_builtin) {
1629 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1631 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1634 if (!II)
1636 else if (II->getBuiltinID() != 0) {
1637 switch (II->getBuiltinID()) {
1647 } else if (II->getTokenID() != tok::identifier ||
1648 II->hasRevertedTokenIDToIdentifier()) {
1656 if (II->getName().startswith("__builtin_") ||
1657 II->getName().startswith("__is_") ||
1658 II->getName().startswith("__has_"))
1660 return llvm::StringSwitch<bool>(II->getName())
1667 return llvm::StringSwitch<bool>(II->getName())
1681 } else if (II == Ident__is_identifier) {
1682 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1686 } else if (II == Ident__has_attribute) {
1687 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1689 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1691 return II ? hasAttribute(AttrSyntax::GNU, nullptr, II,
1694 } else if (II == Ident__has_declspec) {
1695 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1697 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1699 return II ? hasAttribute(AttrSyntax::Declspec, nullptr, II,
1702 } else if (II == Ident__has_cpp_attribute ||
1703 II == Ident__has_c_attribute) {
1704 bool IsCXX = II == Ident__has_cpp_attribute;
1706 OS, Tok, II, *this, [&](Token &Tok, bool &HasLexedNextToken) -> int {
1708 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1710 if (!II)
1719 ScopeII = II;
1721 II = ExpectFeatureIdentifierInfo(Tok, *this,
1726 return II ? hasAttribute(Syntax, ScopeII, II, getTargetInfo(),
1730 } else if (II == Ident__has_include ||
1731 II == Ident__has_include_next) {
1736 if (II == Ident__has_include)
1737 Value = EvaluateHasInclude(Tok, II, *this);
1739 Value = EvaluateHasIncludeNext(Tok, II, *this);
1745 } else if (II == Ident__has_warning) {
1747 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1774 } else if (II == Ident__building_module) {
1778 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1780 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1782 return getLangOpts().isCompilingModule() && II &&
1783 (II->getName() == getLangOpts().CurrentModule);
1785 } else if (II == Ident__MODULE__) {
1791 } else if (II == Ident__identifier) {
1800 << II << tok::l_paren;
1829 } else if (II == Ident__is_target_arch) {
1831 OS, Tok, II, *this, [this](Token &Tok, bool &HasLexedNextToken) -> int {
1832 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1834 return II && isTargetArch(getTargetInfo(), II);
1836 } else if (II == Ident__is_target_vendor) {
1838 OS, Tok, II, *this, [this](Token &Tok, bool &HasLexedNextToken) -> int {
1839 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1841 return II && isTargetVendor(getTargetInfo(), II);
1843 } else if (II == Ident__is_target_os) {
1845 OS, Tok, II, *this, [this](Token &Tok, bool &HasLexedNextToken) -> int {
1846 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1848 return II && isTargetOS(getTargetInfo(), II);
1850 } else if (II == Ident__is_target_environment) {
1852 OS, Tok, II, *this, [this](Token &Tok, bool &HasLexedNextToken) -> int {
1853 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1855 return II && isTargetEnvironment(getTargetInfo(), II);