From 17dc4a6ecc49ccc69870bdb574ae7e67a9b40662 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 30 Jul 2019 21:18:34 -0700 Subject: [PATCH] Construct SourceManager with UserFilesAreVolatile Fix #235. Close #453 In clang, it may be worth generalizing UserFilesAreVolatile (introduced in rC160074) to FilesAreVolatile. --- src/indexer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/indexer.cc b/src/indexer.cc index 240ca756..41c5ca05 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1255,6 +1255,8 @@ Index(SemaManager *manager, WorkingFiles *wfiles, VFS *vfs, Clang->setVirtualFileSystem(FS); Clang->createFileManager(); #endif + Clang->setSourceManager(new SourceManager(Clang->getDiagnostics(), + Clang->getFileManager(), true)); IndexParam param(*vfs, no_linkage); auto DataConsumer = std::make_shared(param);