[PATCH] D17799: Serialize `#pragma comment`.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 2 03:18:42 PST 2016


thakis created this revision.
thakis added a reviewer: rnk.
thakis added a subscriber: cfe-commits.

`#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.)

http://reviews.llvm.org/D17799

Files:
  include/clang/AST/ASTConsumer.h
  include/clang/AST/Decl.h
  include/clang/AST/RecursiveASTVisitor.h
  include/clang/Basic/DeclNodes.td
  include/clang/Basic/PragmaKinds.h
  include/clang/Frontend/MultiplexConsumer.h
  include/clang/Sema/Sema.h
  include/clang/Serialization/ASTBitCodes.h
  lib/AST/ASTContext.cpp
  lib/AST/ASTDumper.cpp
  lib/AST/Decl.cpp
  lib/AST/DeclBase.cpp
  lib/CodeGen/CGDecl.cpp
  lib/CodeGen/CodeGenAction.cpp
  lib/CodeGen/CodeGenModule.cpp
  lib/CodeGen/ModuleBuilder.cpp
  lib/Frontend/MultiplexConsumer.cpp
  lib/Parse/ParsePragma.cpp
  lib/Sema/SemaAttr.cpp
  lib/Sema/SemaTemplateInstantiateDecl.cpp
  lib/Serialization/ASTCommon.cpp
  lib/Serialization/ASTReaderDecl.cpp
  lib/Serialization/ASTWriterDecl.cpp
  test/PCH/pragma-comment.c
  tools/libclang/CIndex.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17799.49594.patch
Type: text/x-patch
Size: 23901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160302/10d9fd52/attachment-0001.bin>


More information about the cfe-commits mailing list