summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexDiagnostic.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-11 22:02:06 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-11 22:02:06 +0000
commit4e0f15a4a247abfcc53563815ce799d2ad45c786 (patch)
tree5a2f800be5b5e6ad6f7a679de3c14e28f425343e /clang/tools/libclang/CIndexDiagnostic.cpp
parentd42340ecfdcd378f4e6c5f8968a7e5c194b10d6b (diff)
downloadbcm5719-llvm-4e0f15a4a247abfcc53563815ce799d2ad45c786.tar.gz
bcm5719-llvm-4e0f15a4a247abfcc53563815ce799d2ad45c786.zip
Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang, since libclang no longer does any of its work out-of-process, making this code dead. Besides, this stuff never worked at 100% anyway. llvm-svn: 116250
Diffstat (limited to 'clang/tools/libclang/CIndexDiagnostic.cpp')
-rw-r--r--clang/tools/libclang/CIndexDiagnostic.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/clang/tools/libclang/CIndexDiagnostic.cpp b/clang/tools/libclang/CIndexDiagnostic.cpp
index 531992efebc..85f451e8554 100644
--- a/clang/tools/libclang/CIndexDiagnostic.cpp
+++ b/clang/tools/libclang/CIndexDiagnostic.cpp
@@ -217,56 +217,3 @@ CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, unsigned FixIt,
}
} // end extern "C"
-
-void clang::LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath,
- unsigned num_unsaved_files,
- struct CXUnsavedFile *unsaved_files,
- FileManager &FileMgr,
- SourceManager &SourceMgr,
- SmallVectorImpl<StoredDiagnostic> &Diags) {
- using llvm::MemoryBuffer;
- using llvm::StringRef;
- MemoryBuffer *F = MemoryBuffer::getFile(DiagnosticsPath.c_str());
- if (!F)
- return;
-
- // Enter the unsaved files into the file manager.
- for (unsigned I = 0; I != num_unsaved_files; ++I) {
- const FileEntry *File = FileMgr.getVirtualFile(unsaved_files[I].Filename,
- unsaved_files[I].Length,
- 0);
- if (!File) {
- // FIXME: Hard to localize when we have no diagnostics engine!
- Diags.push_back(StoredDiagnostic(Diagnostic::Fatal,
- (Twine("could not remap from missing file ") +
- unsaved_files[I].Filename).str()));
- delete F;
- return;
- }
-
- MemoryBuffer *Buffer
- = MemoryBuffer::getMemBuffer(unsaved_files[I].Contents,
- unsaved_files[I].Contents + unsaved_files[I].Length);
- if (!Buffer) {
- delete F;
- return;
- }
-
- SourceMgr.overrideFileContents(File, Buffer);
- SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User);
- }
-
- // Parse the diagnostics, emitting them one by one until we've
- // exhausted the data.
- StringRef Buffer = F->getBuffer();
- const char *Memory = Buffer.data(), *MemoryEnd = Memory + Buffer.size();
- while (Memory != MemoryEnd) {
- StoredDiagnostic Stored = StoredDiagnostic::Deserialize(FileMgr, SourceMgr,
- Memory, MemoryEnd);
- if (!Stored)
- break;
-
- Diags.push_back(Stored);
- }
- delete F;
-}
OpenPOWER on IntegriCloud