#pragma comment was handled by Sema calling a function on ASTConsumer, and CodeGen then implementing this function and writing things to its output.
Instead, introduce a PragmaCommentDecl AST node and hang one off the TranslationUnitDecl for every #pragma comment line, and then use the regular serialization machinery. (Since PragmaCommentDecl has codegen relevance, it's eagerly deserialized.)