[PATCH] D35522: Move Runtime libcall definitions to a .def file

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 09:54:48 PDT 2017


dschuff added a comment.

So it looks like switching the API away from char*-based would be, maybe not super-trivial, but probably not too bad. It's interlinked essentially with other APIs relating to external symbols:
mostly `SelectionDAG::getExternalSymbol()`, and also`MachineInstrBuilder::addExternalSymbol()` but those could be converted too, and I don't think I'd mind doing it as general cleanup. I wonder if Expected<StringRef> is a little heavyweight though. It seems to have a really strong convention that the result should be checked first, and most use cases just don't care (arguably they could assert, but requiring that would add a lot of boilerplate asserts for probably not a lot of benefit). StringRef by itself (with empty string taking the place of the current use of nullptr) wouldn't be too bad, although having the empty string as a sort of sentinel value only used by a small fraction of the uses doesn't seem ideal either. I might still be inclined to prefer that over Expected though. Any thoughts?


Repository:
  rL LLVM

https://reviews.llvm.org/D35522





More information about the llvm-commits mailing list