Lines Matching refs:II
63 Preprocessor::getLocalMacroDirectiveHistory(const IdentifierInfo *II) const {
64 if (!II->hadMacroDefinition())
66 auto Pos = CurSubmoduleState->Macros.find(II);
71 void Preprocessor::appendMacroDirective(IdentifierInfo *II, MacroDirective *MD){
75 MacroState &StoredMD = CurSubmoduleState->Macros[II];
79 StoredMD.overrideActiveModuleMacros(*this, II);
85 PendingModuleMacroNames.push_back(II);
89 II->setHasMacroDefinition(true);
90 if (!MD->isDefined() && LeafModuleMacros.find(II) == LeafModuleMacros.end())
91 II->setHasMacroDefinition(false);
92 if (II->isFromAST())
93 II->setChangedSinceDeserialization();
96 void Preprocessor::setLoadedMacroDirective(IdentifierInfo *II,
108 assert(II && MD);
109 MacroState &StoredMD = CurSubmoduleState->Macros[II];
127 II->setHasMacroDefinition(true);
128 if (!MD->isDefined() && LeafModuleMacros.find(II) == LeafModuleMacros.end())
129 II->setHasMacroDefinition(false);
132 ModuleMacro *Preprocessor::addModuleMacro(Module *Mod, IdentifierInfo *II,
137 ModuleMacro::Profile(ID, Mod, II);
145 auto *MM = ModuleMacro::create(*this, Mod, II, Macro, Overrides);
156 auto &LeafMacros = LeafModuleMacros[II];
168 II->setHasMacroDefinition(true);
175 const IdentifierInfo *II) {
177 ModuleMacro::Profile(ID, Mod, II);
183 void Preprocessor::updateModuleMacroInfo(const IdentifierInfo *II,
191 auto Leaf = LeafModuleMacros.find(II);
261 void Preprocessor::dumpMacroInfo(const IdentifierInfo *II) {
263 auto LeafIt = LeafModuleMacros.find(II);
267 auto Pos = CurSubmoduleState->Macros.find(II);
271 llvm::errs() << "MacroState " << State << " " << II->getNameStart();
272 if (State && State->isAmbiguous(*this, II))
290 for (auto *MM : State ? State->getActiveModuleMacros(*this, II) : None)
405 IdentifierInfo *II = MI->getReplacementToken(0).getIdentifierInfo();
408 if (!II) return true;
412 if (II->isOutOfDate())
413 PP.getExternalSource()->updateOutOfDateIdentifier(*II);
417 if (auto *ExpansionMI = PP.getMacroInfo(II))
420 II != MacroIdent)
429 return std::find(MI->param_begin(), MI->param_end(), II) == MI->param_end();
1158 IdentifierInfo *II, Preprocessor &PP,
1167 PP.Diag(LParenLoc, diag::err_pp_directive_required) << II;
1170 Tok.setIdentifierInfo(II);
1184 PP.Diag(LParenLoc, diag::err_pp_expected_after) << II << tok::l_paren;
1216 << II << tok::r_paren;
1247 static bool EvaluateHasInclude(Token &Tok, IdentifierInfo *II,
1249 return EvaluateHasIncludeCommon(Tok, II, PP, nullptr, nullptr);
1255 IdentifierInfo *II, Preprocessor &PP) {
1283 return EvaluateHasIncludeCommon(Tok, II, PP, Lookup, LookupFromFile);
1289 Token &Tok, IdentifierInfo *II,
1297 PP.Diag(Tok.getLocation(), diag::err_pp_expected_after) << II
1339 PP.Diag(Tok.getLocation(), diag::err_pp_nested_paren) << II;
1398 IdentifierInfo *II;
1399 if (!Tok.isAnnotation() && (II = Tok.getIdentifierInfo()))
1400 return II;
1407 static bool isTargetArch(const TargetInfo &TI, const IdentifierInfo *II) {
1408 std::string ArchName = II->getName().lower() + "--";
1429 static bool isTargetVendor(const TargetInfo &TI, const IdentifierInfo *II) {
1433 return VendorName.equals_lower(II->getName());
1437 static bool isTargetOS(const TargetInfo &TI, const IdentifierInfo *II) {
1439 (llvm::Twine("unknown-unknown-") + II->getName().lower()).str();
1450 const IdentifierInfo *II) {
1451 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,
1633 if (!II)
1635 else if (II->getBuiltinID() != 0) {
1636 switch (II->getBuiltinID()) {
1646 } else if (II->getTokenID() != tok::identifier ||
1647 II->hasRevertedTokenIDToIdentifier()) {
1655 if (II->getName().startswith("__builtin_") ||
1656 II->getName().startswith("__is_") ||
1657 II->getName().startswith("__has_"))
1659 return llvm::StringSwitch<bool>(II->getName())
1666 return llvm::StringSwitch<bool>(II->getName())
1680 } else if (II == Ident__is_identifier) {
1681 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1685 } else if (II == Ident__has_attribute) {
1686 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1688 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1690 return II ? hasAttribute(AttrSyntax::GNU, nullptr, II,
1693 } else if (II == Ident__has_declspec) {
1694 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1696 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1698 if (II) {
1701 hasAttribute(AttrSyntax::Declspec, nullptr, II,
1707 } else if (II == Ident__has_cpp_attribute ||
1708 II == Ident__has_c_attribute) {
1709 bool IsCXX = II == Ident__has_cpp_attribute;
1711 OS, Tok, II, *this, [&](Token &Tok, bool &HasLexedNextToken) -> int {
1713 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1715 if (!II)
1724 ScopeII = II;
1726 II = ExpectFeatureIdentifierInfo(Tok, *this,
1731 return II ? hasAttribute(Syntax, ScopeII, II, getTargetInfo(),
1735 } else if (II == Ident__has_include ||
1736 II == Ident__has_include_next) {
1741 if (II == Ident__has_include)
1742 Value = EvaluateHasInclude(Tok, II, *this);
1744 Value = EvaluateHasIncludeNext(Tok, II, *this);
1750 } else if (II == Ident__has_warning) {
1752 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1779 } else if (II == Ident__building_module) {
1783 EvaluateFeatureLikeBuiltinMacro(OS, Tok, II, *this,
1785 IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this,
1787 return getLangOpts().isCompilingModule() && II &&
1788 (II->getName() == getLangOpts().CurrentModule);
1790 } else if (II == Ident__MODULE__) {
1796 } else if (II == Ident__identifier) {
1805 << II << tok::l_paren;
1841 } else if (II == Ident__is_target_arch) {
1843 OS, Tok, II, *this, [this](Token &Tok, bool &HasLexedNextToken) -> int {
1844 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1846 return II && isTargetArch(getTargetInfo(), II);
1848 } else if (II == Ident__is_target_vendor) {
1850 OS, Tok, II, *this, [this](Token &Tok, bool &HasLexedNextToken) -> int {
1851 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1853 return II && isTargetVendor(getTargetInfo(), II);
1855 } else if (II == Ident__is_target_os) {
1857 OS, Tok, II, *this, [this](Token &Tok, bool &HasLexedNextToken) -> int {
1858 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1860 return II && isTargetOS(getTargetInfo(), II);
1862 } else if (II == Ident__is_target_environment) {
1864 OS, Tok, II, *this, [this](Token &Tok, bool &HasLexedNextToken) -> int {
1865 IdentifierInfo *II = ExpectFeatureIdentifierInfo(
1867 return II && isTargetEnvironment(getTargetInfo(), II);