[PATCH] D24828: [clang-move] The new.cc file should include new_header.h instead of old_header.h
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 22 08:03:42 PDT 2016
ioeric accepted this revision.
ioeric added a comment.
This revision is now accepted and ready to land.
Lg with nits.
================
Comment at: clang-move/ClangMove.cpp:290
@@ -294,1 +289,3 @@
llvm::StringRef FileName) {
+ // Don't add the old_header.h to the new files.
+ if (!Spec.OldHeader.empty() && IncludeHeader.endswith(Spec.OldHeader))
----------------
I think we also need a FIXME here. There could be interesting dependency: if the new target depends on the old target, then it makes sense to add the header.
================
Comment at: clang-move/ClangMove.cpp:295
@@ +294,3 @@
+ std::string IncludeLine = IsAngled
+ ? "#include <" + IncludeHeader.str() + ">\n"
+ : "#include \"" + IncludeHeader.str() + "\"\n";
----------------
I think `("#include <" + IncludeHeader + ">\n").str()` is more efficient since it only creates one string instance.
https://reviews.llvm.org/D24828
More information about the cfe-commits
mailing list