[PATCH] D27831: [ELF] - Linkerscript: Fall back to search paths when INCLUDE not found

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 15:51:21 PST 2016

ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM with nits. Thank you for doing this!

Comment at: ELF/LinkerScript.cpp:1187
 void ScriptParser::readInclude() {
-  StringRef Tok = next();
-  auto MBOrErr = MemoryBuffer::getFile(unquote(Tok));
+  auto Tok = unquote(next());
+  // https://sourceware.org/binutils/docs/ld/File-Commands.html:
Please avoid `auto` and use `StringRef` as its type is not obvious by RHS.

Comment at: ELF/LinkerScript.cpp:1193
+  if (!MBOrErr)
+    if (auto Path = findFromSearchPaths(Tok))
+      MBOrErr = MemoryBuffer::getFile(*Path);
Use `Optional<StringRef>` instead of `auto`.


More information about the llvm-commits mailing list