xazax.hun added inline comments.

================
Comment at: lib/StaticAnalyzer/Core/PathDiagnostic.cpp:418-423
     SourceLocation XDL = XD->getLocation();
     SourceLocation YDL = YD->getLocation();
     if (XDL != YDL) {
       const SourceManager &SM = XL.getManager();
-      return SM.isBeforeInTranslationUnit(XDL, YDL);
+      return compareCrossTUSourceLocs(FullSourceLoc(XDL, SM),
+                                      FullSourceLoc(YDL, SM));
----------------
NoQ wrote:
> xazax.hun wrote:
> > NoQ wrote:
> > > It seems to me that `XDL` and `YDL` are exactly the same as `XL` and `YL` 
> > > we've seen at the beginning of the function.
> > > 
> > > ...we still have only one `SourceManager`, right?
> > Is this true? 
> > One is the location associated with the PathDiagnostic the other is the 
> > location of the Decl associated with the issue. I do not have deep 
> > understanding of this part of the code but not sure if these are guaranteed 
> > to be the same.
> Whoops, you're totally right, never mind.
> 
> Comments might have probably helped me understand that faster.
Sure, comments might help, but I want to keep the changes in this patch focused 
and minimal, so I prefer to do such modifications in a separate patch.


https://reviews.llvm.org/D30691



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to