[PATCH] Last-chance diagnostics for incomplete types
Nick Lewycky
nlewycky at google.com
Mon Jul 22 17:06:59 PDT 2013
On 12 July 2013 17:01, Luke Zarko <zarko at google.com> wrote:
> Ping--any opinions on this or thoughts on better ways to do it?
>
>From the peanut gallery! I fundamentally like the direction this is going.
+ /// \brief Maybe produce a diagnostic note if this class can find a
+ /// way to get at the complete definition for T.
Is this clearer?: "Produces a diagnostic note if the external source
contains a complete definition for T."
+ for(size_t i = 0; i < Sources.size(); ++i)
Space after 'for'. Also, hoist out the computation of Sources.size(). See
http://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop
What prevents us from emitting the same diagnostic note twice? What if two
external sources both contain full definitions of the type (for instance,
modules X and Y both include module Z which defines the type, but they
don't expose Z's contents to their users)?
\ No newline at end of file
Please keep a newline at the end of MultiplexExternalSemaSource.cpp.
Nick
On Tue, Jul 9, 2013 at 3:45 PM, Luke Zarko <zarko at google.com> wrote:
> > This patch adds a method to ExternalSemaSource to allow it to produce
> > diagnostics when an incomplete type was detected where a complete type
> > was required. For example, one could define an ExternalSemaSource that
> > scans a repository for headers providing a missing definition.
> >
> > The purpose of the MaybeDiagnoseMissingCompleteType method differs
> > from that of the existing ExternalASTSource::CompleteType method. The
> > former is invoked to diagnose a single SourceLocation-ed
> > missing-complete-type site where there is no chance for recovery. The
> > latter may be called in the course of compiling a valid source file
> > with some of its definitions available in external but otherwise
> > available locations.
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130722/ff3b718b/attachment.html>
More information about the cfe-commits
mailing list