sammccall added inline comments.
================ Comment at: lib/Lex/PPDirectives.cpp:1898 + } + if (Filename.empty()) + return Filename; ---------------- kristina wrote: > sammccall wrote: > > simplify the logic by merging with the while loop? (and drop the assert) > I thought the assert was a good idea in case a similar issue popped up again > (somehow triggering this but in reverse, not sure if that makes sense), it's > a no-op in upstream release builds anyway. `while (!empty && !isAlpha(back)) { drop_back }` is just as safe, and easier to understand than ``` // ... subtly establish that there is an alphanum in the string ... while (!isAlpha(back)) { drop_back; assert(!empty) } ``` 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