================
Comment at: lib/Sema/SemaExpr.cpp:7027-7029
@@ +7026,5 @@
+
+  // Check that left hand side is !something.
+  UnaryOperator *UO = dyn_cast<UnaryOperator>(LHS.get());
+  if (!UO || UO->getOpcode() != UO_LNot) return;
+
----------------
Tiny thing: this is probably cheaper than the type check for the RHS, and will 
bail out much more often; maybe move this check earlier?

================
Comment at: lib/Sema/SemaExpr.cpp:7041
@@ +7040,3 @@
+  SourceLocation FirstOpen = SubExpr->getLocStart();
+  SourceLocation FirstClose = RHS.get()->getSourceRange().getEnd();
+  FirstClose = S.getPreprocessor().getLocForEndOfToken(FirstClose);
----------------
RHS.get()->getLocEnd()

================
Comment at: lib/Sema/SemaExpr.cpp:7048-7049
@@ +7047,4 @@
+  // Second note suggests (!x) < y
+  SourceLocation SecondOpen = LHS.get()->getLocStart();
+  SourceLocation SecondClose = LHS.get()->getSourceRange().getEnd();
+  SecondClose = S.getPreprocessor().getLocForEndOfToken(SecondClose);
----------------
LHS.get()->getLocEnd(), or use LHS.get()->getSourceRange() to get both at once 
(which is slightly cheaper).


http://llvm-reviews.chandlerc.com/D505
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to