diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-28 06:00:51 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-28 06:00:51 +0000 |
commit | d93256e55673a17d18543397ec462416acb13792 (patch) | |
tree | 5b150fa660dcb777d022715e66051091d9bb9ffa /include/clang/Basic/SourceManager.h | |
parent | a8d8fec7876666d90bb2a144d3b832b2d89a088a (diff) |
Introduce serialization and deserialization of diagnostic information
so that CIndex can report diagnostics through the normal mechanisms
even when executing Clang in a separate process. This applies both
when performing code completion and when using ASTs as an intermediary
for clang_createTranslationUnitFromSourceFile().
The serialized format is not perfect at the moment, because it does
not encapsulate macro-instantiation information. Instead, it maps all
source locations back to the instantiation location. However, it does
maintain source-range and fix-it information. To get perfect fidelity
from the serialized format would require serializing a large chunk of
the source manager; at present, it isn't clear if this code will live
long enough for that to matter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 59984e7ee8..15ece68510 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -669,6 +669,9 @@ public: ::const_iterator fileinfo_iterator; fileinfo_iterator fileinfo_begin() const { return FileInfos.begin(); } fileinfo_iterator fileinfo_end() const { return FileInfos.end(); } + bool hasFileInfo(const FileEntry *File) const { + return FileInfos.find(File) != FileInfos.end(); + } /// PrintStats - Print statistics to stderr. /// |