Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(890)

Issue 4898054: [pph] New test - highlights issue with loading of pph child references (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 7 months ago by Gabriel Charette
Modified:
13 years, 7 months ago
CC:
gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -0 lines) Patch
A gcc/testsuite/g++.dg/pph/c0deepincl1.h View 1 chunk +6 lines, -0 lines 0 comments Download
A gcc/testsuite/g++.dg/pph/c1deepincl2.h View 1 chunk +8 lines, -0 lines 0 comments Download
A gcc/testsuite/g++.dg/pph/c2deepincl.cc View 1 chunk +7 lines, -0 lines 0 comments Download
A gcc/testsuite/g++.dg/pph/c2deepincl3.h View 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 1
Gabriel Charette
13 years, 7 months ago (2011-08-16 23:17:59 UTC) #1
I noticed an issue while reading the code the child referencing code more in
depth and wrote the following tests which exposes that issue.

We are loading every single header in the translation unit (not only the direct
children) when doing pph_in_includes, but the children themselves correctly load
their children; thus we end up with multiple instances of the same things.

I think this is due to the fact that everytime we call pph_read_file we add the
file read to the list of includes (i.e. this also adds children of children to
the includes list when the children itself is read and reads its children...).

I'm working on a better linemap streaming, but I must rely on the list of
includes consisting only of the top-level includes (direct children) for the
current pph.

Committed to pph.

Gab

2011-08-16  Gabriel Charette  <gchare@google.com>

	* g++.dg/pph/c0deepincl1.h: New.
	* g++.dg/pph/c1deepincl2.h: New.
	* g++.dg/pph/c2deepincl3.h: New.
	* g++.dg/pph/c2deepincl.cc: New asm xdiff.

diff --git a/gcc/testsuite/g++.dg/pph/c0deepincl1.h
b/gcc/testsuite/g++.dg/pph/c0deepincl1.h
new file mode 100644
index 0000000..4360163
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/c0deepincl1.h
@@ -0,0 +1,6 @@
+#ifndef C0DEEPINCL1_H
+#define C0DEEPINCL1_H
+
+int a = 0;
+
+#endif
diff --git a/gcc/testsuite/g++.dg/pph/c1deepincl2.h
b/gcc/testsuite/g++.dg/pph/c1deepincl2.h
new file mode 100644
index 0000000..4861064
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/c1deepincl2.h
@@ -0,0 +1,8 @@
+#ifndef C1DEEPINCL2_H
+#define C1DEEPINCL2_H
+
+#include "c0deepincl1.h"
+
+int b = 1;
+
+#endif
diff --git a/gcc/testsuite/g++.dg/pph/c2deepincl.cc
b/gcc/testsuite/g++.dg/pph/c2deepincl.cc
new file mode 100644
index 0000000..da56b1e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/c2deepincl.cc
@@ -0,0 +1,7 @@
+// pph asm xdiff 00611
+
+#include "c2deepincl3.h"
+
+int test() {
+    return a + b + c;
+}
diff --git a/gcc/testsuite/g++.dg/pph/c2deepincl3.h
b/gcc/testsuite/g++.dg/pph/c2deepincl3.h
new file mode 100644
index 0000000..d3a1522
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/c2deepincl3.h
@@ -0,0 +1,8 @@
+#ifndef C2DEEPINCL3_H
+#define C2DEEPINCL3_H
+
+#include "c1deepincl2.h"
+
+int c = 2;
+
+#endif

--
This patch is available for review at http://codereview.appspot.com/4898054
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b