Debian Codegraph @

debian/patches/287.diff

raw
1 diff --git a/clang_delta/Transformation.cpp b/clang_delta/Transformation.cpp
2 index b350eec5..707a0209 100644
3 --- a/clang_delta/Transformation.cpp
4 +++ b/clang_delta/Transformation.cpp
5 @@ -95,7 +95,7 @@ void Transformation::Initialize(ASTContext &context)
6 void Transformation::outputTransformedSource(llvm::raw_ostream &OutStream)
7 {
8 FileID MainFileID = SrcManager->getMainFileID();
9 - const RewriteBuffer *RWBuf = TheRewriter.getRewriteBufferFor(MainFileID);
10 + const llvm::RewriteBuffer *RWBuf = TheRewriter.getRewriteBufferFor(MainFileID);
11
12 // RWBuf is non-empty upon any rewrites
13 TransAssert(RWBuf && "Empty RewriteBuffer!");
14 diff --git a/clang_delta/TransformationManager.cpp b/clang_delta/TransformationManager.cpp
15 index 79b17cee..e16e07ce 100644
16 --- a/clang_delta/TransformationManager.cpp
17 +++ b/clang_delta/TransformationManager.cpp
18 @@ -24,6 +24,7 @@
19 #include "clang/Lex/PreprocessorOptions.h"
20 #include "clang/Frontend/CompilerInstance.h"
21 #include "clang/Parse/ParseAST.h"
22 +#include "llvm/Support/VirtualFileSystem.h" // For llvm::vfs::get GlobalVirtualFileSystem()
23
24 #include "Transformation.h"
25
26 @@ -90,8 +91,14 @@ bool TransformationManager::initializeCompilerInstance(std::string &ErrorMsg)
27
28 ClangInstance = new CompilerInstance();
29 assert(ClangInstance);
30 -
31 +
32 +#if LLVM_VERSION_MAJOR >= 20
33 + // Get the global virtual file system
34 + auto VFS = llvm::vfs::getRealFileSystem();
35 + ClangInstance->createDiagnostics(*VFS);
36 +#else
37 ClangInstance->createDiagnostics();
38 +#endif
39
40 TargetOptions &TargetOpts = ClangInstance->getTargetOpts();
41 PreprocessorOptions &PPOpts = ClangInstance->getPreprocessorOpts();