diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-24 21:04:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-24 21:04:06 +0000 |
commit | f7353c08d440aa3c1db46b181aff6c4eb41bbcab (patch) | |
tree | 9326f4753900488b98dc436ff57814914b41cca6 | |
parent | 528adb129faa6e8ca17be561539c7eede1fc024d (diff) |
Make sure that we have File IDs for all of the unsaved files before we
deserialize diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99426 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Index/Inputs/remap-complete-to.c | 7 | ||||
-rw-r--r-- | test/Index/remap-complete.c | 7 | ||||
-rw-r--r-- | tools/CIndex/CIndexDiagnostic.cpp | 1 |
3 files changed, 12 insertions, 3 deletions
diff --git a/test/Index/Inputs/remap-complete-to.c b/test/Index/Inputs/remap-complete-to.c index 9f8be2cbec..30199db51a 100644 --- a/test/Index/Inputs/remap-complete-to.c +++ b/test/Index/Inputs/remap-complete-to.c @@ -1 +1,6 @@ -void f0() { } +int f0(int *pointer1, float *pointer2) { + return pointer2 - pointer1; +} + +void g() { + diff --git a/test/Index/remap-complete.c b/test/Index/remap-complete.c index 9b7de0699d..813d1dfcf4 100644 --- a/test/Index/remap-complete.c +++ b/test/Index/remap-complete.c @@ -1,5 +1,8 @@ -// RUN: c-index-test -code-completion-at=%s:1:12 -remap-file="%s;%S/Inputs/remap-complete-to.c" %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:6:2 -remap-file="%s;%S/Inputs/remap-complete-to.c" %s 2> %t.err | FileCheck %s +// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t.err // XFAIL: win32 -// CHECK: FunctionDecl:{ResultType void}{TypedText f0}{LeftParen (}{RightParen )} +// CHECK: FunctionDecl:{ResultType int}{TypedText f0}{LeftParen (} void f() { } + +// CHECK-DIAGS: remap-complete.c:2:19 diff --git a/tools/CIndex/CIndexDiagnostic.cpp b/tools/CIndex/CIndexDiagnostic.cpp index 6aed49eaae..f4454d46f6 100644 --- a/tools/CIndex/CIndexDiagnostic.cpp +++ b/tools/CIndex/CIndexDiagnostic.cpp @@ -265,6 +265,7 @@ void clang::LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath, } SourceMgr.overrideFileContents(File, Buffer); + SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User); } // Parse the diagnostics, emitting them one by one until we've |