================
@@ -1386,6 +1402,77 @@ bool Parser::HandlePragmaMSAllocText(StringRef 
PragmaName,
   return true;
 }
 
+void Parser::zOSHandlePragmaHelper(tok::TokenKind PragmaKind) {
+  assert(Tok.is(PragmaKind));
+
+  StringRef PragmaName = "export";
+
+  using namespace clang::charinfo;
+  auto *TheTokens =
+      (std::pair<std::unique_ptr<Token[]>, size_t> *)Tok.getAnnotationValue();
+  PP.EnterTokenStream(std::move(TheTokens->first), TheTokens->second, true,
+                      false);
+  ConsumeAnnotationToken();
+
+  auto SkipToEnd = [this]() {
----------------
perry-ca wrote:

What I have handles the tokens the same way the other pragma parsing functions 
in ParsePragma.cpp like   `HandlePragmaAttribute()`.  The other practice is to 
use the bool return type to indicate if the tokens up to, and including, EOF 
need to be consumed.  Looks like another area for code improvements.

The SkipUntil call does consume the EOF token after and SkipUntil won't consume 
more tokens if the current is already EOF.  It looks like I can do what you 
suggest.

I'll change the code to use llvm::scope_exit.

https://github.com/llvm/llvm-project/pull/141671
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to