[clang] [SystemZ][z/OS] Implement #pragma export (PR #141671)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue May 27 14:51:02 PDT 2025
================
@@ -1395,6 +1411,171 @@ bool Parser::HandlePragmaMSAllocText(StringRef PragmaName,
return true;
}
+NestedNameSpecifier *
+Parser::zOSParseIdentifier(StringRef PragmaName,
+ const IdentifierInfo *IdentName) {
+ NestedNameSpecifier *NestedId = nullptr;
+ if (PP.getLangOpts().CPlusPlus) {
+ if (Tok.is(tok::coloncolon)) {
+ // Nothing to do.
+ } else if (Actions.CurContext->isNamespace()) {
+ auto *NS = cast<NamespaceDecl>(Actions.CurContext);
+ NestedId =
+ NestedNameSpecifier::Create(Actions.Context, NS->getIdentifier());
+ NestedId =
+ NestedNameSpecifier::Create(Actions.Context, NestedId, IdentName);
+ PP.Lex(Tok);
+ } else {
+ NestedId = NestedNameSpecifier::Create(Actions.Context, IdentName);
+ PP.Lex(Tok);
+ }
+ while (Tok.is(tok::coloncolon)) {
+ PP.Lex(Tok);
+ if (Tok.isNot(tok::identifier)) {
+ PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
+ << PragmaName;
+ return nullptr;
+ }
+ IdentifierInfo *II = Tok.getIdentifierInfo();
----------------
erichkeane wrote:
Identifier isn't sufficient, what if this is naming a type inside a template? Or a dependent type?
https://github.com/llvm/llvm-project/pull/141671
More information about the cfe-commits
mailing list