sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Lex/PPDirectives.cpp:1895
+        auto CorrectTypoFilename = [](llvm::StringRef Filename) {
+          while (!Filename.empty() && !isAlphanumeric(Filename.front())) {
+            Filename = Filename.drop_front();
----------------
`Filename = Filename.drop_until(isAlphanumeric)`

(unfortunately there's no equivalent "back" version)




================
Comment at: lib/Lex/PPDirectives.cpp:1898
+          }
+          if (Filename.empty())
+            return Filename;
----------------
simplify the logic by merging with the while loop? (and drop the assert)


================
Comment at: lib/Lex/PPDirectives.cpp:1909
+        File = Filename.empty()
+                   ? nullptr
+                   : LookupFile(FilenameLoc,
----------------
if this early bail-out isn't necessary, please drop it - it's optimizing an 
extremely uncommon case


Repository:
  rC Clang

https://reviews.llvm.org/D52721



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

Reply via email to