From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3631 invoked by alias); 14 Oct 2011 12:16:31 -0000 Received: (qmail 3619 invoked by uid 22791); 14 Oct 2011 12:16:27 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Oct 2011 12:16:08 +0000 Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id p9ECG6YT010308 for ; Fri, 14 Oct 2011 05:16:06 -0700 Received: from yxk36 (yxk36.prod.google.com [10.190.3.164]) by wpaz37.hot.corp.google.com with ESMTP id p9ECC4JD026427 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 14 Oct 2011 05:16:05 -0700 Received: by yxk36 with SMTP id 36so559797yxk.7 for ; Fri, 14 Oct 2011 05:16:05 -0700 (PDT) Received: by 10.101.82.2 with SMTP id j2mr1685722anl.110.1318594565216; Fri, 14 Oct 2011 05:16:05 -0700 (PDT) Received: by 10.101.82.2 with SMTP id j2mr1685717anl.110.1318594565041; Fri, 14 Oct 2011 05:16:05 -0700 (PDT) Received: from dhcp-172-29-42-217.tor.corp.google.com ([2620:0:101b:9:e2f8:47ff:fe39:637a]) by mx.google.com with ESMTPS id 8sm8896135anv.9.2011.10.14.05.16.04 (version=SSLv3 cipher=OTHER); Fri, 14 Oct 2011 05:16:04 -0700 (PDT) Message-ID: <4E982809.1010302@google.com> Date: Fri, 14 Oct 2011 13:43:00 -0000 From: Diego Novillo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Gabriel Charette CC: reply@codereview.appspotmail.com, crowl@google.com, gcc-patches@gcc.gnu.org Subject: Re: [pph] Make libcpp symbol validation a warning (issue5235061) References: <20111011202636.D76B41DA1D2@topo.tor.corp.google.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg01270.txt.bz2 On 11-10-13 17:55 , Gabriel Charette wrote: > I'm not sure exactly how you skip headers already parsed now (we > didn't used to when I wrote this code and that was the only problem > remaining in the line_table (i.e. duplicate entries for guarded > headers in the non-pph compile)), but couldn't you count the number of > skipped entries and assert (line_table->used - used_before) + > numSkipped == expected_in) ? The problem is that the compilation process of foo.h -> foo.pph may generate different line tables than a compile that includes foo.pph. For instance, foo.h: #include "1.pph" #include "2.pph" #include "3.pph" foo.cc: #include "2.pph" #include "foo.pph" When we compile foo.h, the line table incorporates the effects of including 2.pph, and that's what we save to foo.pph. However, when compiling foo.cc, the first thing we do is include 2.pph, so when processing the include for foo.pph, we will completely skip over 2.pph. That's why we cannot really have the same line table that we had when we generated foo.pph. Diego.