aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2024-11-11 11:01:01 -0800
committerGitHub <noreply@github.com>2024-11-11 11:01:01 -0800
commita2f9d1d078cefc3ee7b19610f7117d1fb1369f18 (patch)
tree3b2161c51c4857f17d4599be2fb8ecbdb6b47092 /clang/lib/Frontend/ASTUnit.cpp
parent058ac837bc35419bbbb34f3206f5aa229c669811 (diff)
downloadllvm-a2f9d1d078cefc3ee7b19610f7117d1fb1369f18.zip
llvm-a2f9d1d078cefc3ee7b19610f7117d1fb1369f18.tar.gz
llvm-a2f9d1d078cefc3ee7b19610f7117d1fb1369f18.tar.bz2
[clang][serialization] Enable `ASTWriter` to work with `Preprocessor` only (#115237)
This PR builds on top of https://github.com/llvm/llvm-project/pull/115235 and makes it possible to call `ASTWriter::WriteAST()` with `Preprocessor` only instead of full `Sema` object. So far, there are no clients that leverage the new capability - that will come in a follow-up commit.
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 4aec928..f58e27a 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -2359,7 +2359,7 @@ bool ASTUnit::Save(StringRef File) {
static bool serializeUnit(ASTWriter &Writer, SmallVectorImpl<char> &Buffer,
Sema &S, raw_ostream &OS) {
- Writer.WriteAST(S, std::string(), nullptr, "");
+ Writer.WriteAST(&S, std::string(), nullptr, "");
// Write the generated bitstream to "Out".
if (!Buffer.empty())