diff --git a/clang-tools-extra/pseudo/include/clang-pseudo/Token.h b/clang-tools-extra/pseudo/include/clang-pseudo/Token.h --- a/clang-tools-extra/pseudo/include/clang-pseudo/Token.h +++ b/clang-tools-extra/pseudo/include/clang-pseudo/Token.h @@ -161,6 +161,9 @@ return Storage[1]; } + /// Returns the shared payload. + std::shared_ptr getPayload() const { return Payload; } + /// Print the tokens in this stream to the output stream. /// /// The presence of newlines/spaces is preserved, but not the quantity. diff --git a/clang-tools-extra/pseudo/lib/Token.cpp b/clang-tools-extra/pseudo/lib/Token.cpp --- a/clang-tools-extra/pseudo/lib/Token.cpp +++ b/clang-tools-extra/pseudo/lib/Token.cpp @@ -116,7 +116,7 @@ } TokenStream stripComments(const TokenStream &Input) { - TokenStream Out; + TokenStream Out(Input.getPayload()); for (const Token &T : Input.tokens()) { if (T.Kind == tok::comment) continue;