[clang] [clang][serialization] Make `ASTWriter` work with `Preprocessor` only (PR #115237)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 6 15:54:47 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 304c41217303ce613de8f4042e570ac6ca8757e8 5e66ce95bfb7cb401b5757f8491a89d369ad2010 --extensions h,cpp -- clang/include/clang/Serialization/ASTRecordWriter.h clang/include/clang/Serialization/ASTWriter.h clang/lib/Frontend/ASTUnit.cpp clang/lib/Serialization/ASTWriter.cpp clang/lib/Serialization/ASTWriterDecl.cpp clang/lib/Serialization/ASTWriterStmt.cpp clang/lib/Serialization/GeneratePCH.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/include/clang/Serialization/ASTWriter.h b/clang/include/clang/Serialization/ASTWriter.h
index 7b5b011787..e8e7a23e45 100644
--- a/clang/include/clang/Serialization/ASTWriter.h
+++ b/clang/include/clang/Serialization/ASTWriter.h
@@ -673,7 +673,7 @@ public:
   ///
   /// \return the module signature, which eventually will be a hash of
   /// the module but currently is merely a random 32-bit number.
-  ASTFileSignature WriteAST(llvm::PointerUnion<Sema *, Preprocessor*> Subject,
+  ASTFileSignature WriteAST(llvm::PointerUnion<Sema *, Preprocessor *> Subject,
                             StringRef OutputFile, Module *WritingModule,
                             StringRef isysroot,
                             bool ShouldCacheASTInMemory = false);
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 43fac29f32..9a45582eb3 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -278,7 +278,7 @@ class ASTTypeWriter {
 
 public:
   ASTTypeWriter(ASTContext &Context, ASTWriter &Writer)
-    : Writer(Writer), BasicWriter(Context, Writer, Record) {}
+      : Writer(Writer), BasicWriter(Context, Writer, Record) {}
 
   uint64_t write(QualType T) {
     if (T.hasLocalNonFastQualifiers()) {

``````````

</details>


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


More information about the cfe-commits mailing list