[clang] mark the tokens for pragma export as reinjected (PR #177979)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 26 07:46:53 PST 2026


================
@@ -1412,7 +1412,7 @@ void Parser::zOSHandlePragmaHelper(tok::TokenKind PragmaKind) {
   auto *TheTokens =
       (std::pair<std::unique_ptr<Token[]>, size_t> *)Tok.getAnnotationValue();
   PP.EnterTokenStream(std::move(TheTokens->first), TheTokens->second, true,
-                      false);
+                      /*IsReinject=*/true);
----------------
erichkeane wrote:

Since ownership is being transfered, we should likely mark `Tok.getAnnotatedValue` as null to make it clear it no longer owns the pointer.  

https://github.com/llvm/llvm-project/pull/177979


More information about the cfe-commits mailing list