[cfe-commits] r99426 - in /cfe/trunk: test/Index/Inputs/remap-complete-to.c test/Index/remap-complete.c tools/CIndex/CIndexDiagnostic.cpp
Douglas Gregor
dgregor at apple.com
Wed Mar 24 14:04:06 PDT 2010
Author: dgregor
Date: Wed Mar 24 16:04:06 2010
New Revision: 99426
URL: http://llvm.org/viewvc/llvm-project?rev=99426&view=rev
Log:
Make sure that we have File IDs for all of the unsaved files before we
deserialize diagnostics.
Modified:
cfe/trunk/test/Index/Inputs/remap-complete-to.c
cfe/trunk/test/Index/remap-complete.c
cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp
Modified: cfe/trunk/test/Index/Inputs/remap-complete-to.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Inputs/remap-complete-to.c?rev=99426&r1=99425&r2=99426&view=diff
==============================================================================
--- cfe/trunk/test/Index/Inputs/remap-complete-to.c (original)
+++ cfe/trunk/test/Index/Inputs/remap-complete-to.c Wed Mar 24 16:04:06 2010
@@ -1 +1,6 @@
-void f0() { }
+int f0(int *pointer1, float *pointer2) {
+ return pointer2 - pointer1;
+}
+
+void g() {
+
Modified: cfe/trunk/test/Index/remap-complete.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/remap-complete.c?rev=99426&r1=99425&r2=99426&view=diff
==============================================================================
--- cfe/trunk/test/Index/remap-complete.c (original)
+++ cfe/trunk/test/Index/remap-complete.c Wed Mar 24 16:04:06 2010
@@ -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
Modified: cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp?rev=99426&r1=99425&r2=99426&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp Wed Mar 24 16:04:06 2010
@@ -265,6 +265,7 @@
}
SourceMgr.overrideFileContents(File, Buffer);
+ SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User);
}
// Parse the diagnostics, emitting them one by one until we've
More information about the cfe-commits
mailing list