rsmith added a subscriber: rsmith.
rsmith accepted this revision.
rsmith added a reviewer: rsmith.
This revision is now accepted and ready to land.

================
Comment at: lib/Frontend/HeaderIncludeGen.cpp:155-156
@@ -151,3 +154,4 @@
 
   // Dump the header include information we are past the predefines buffer or
   // are showing all headers.
+  if (ShowHeader && Reason == PPCallbacks::EnterFile &&
----------------
Missing "if" or similar in this comment?

================
Comment at: lib/Frontend/HeaderIncludeGen.cpp:158
@@ +157,3 @@
+  if (ShowHeader && Reason == PPCallbacks::EnterFile &&
+      strcmp(UserLoc.getFilename(), "<command line>")) {
+    PrintHeaderInfo(OutputFile, UserLoc.getFilename(), ShowDepth, IncludeDepth,
----------------
I'm not a fan of using `strcmp` like this (implicitly converting the result to 
`bool` to mean "check strings are different"). I'd prefer you used

    UserLoc.getFilename() != StringRef("<command line>")

(Of course, ideally we'd use something more principled than a check against the 
filename string... please add a FIXME for that.)


http://reviews.llvm.org/D18401



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

Reply via email to