[PATCH] D53945: [TextAPI] TBD Reader/Writer

Juergen Ributzka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 10:46:12 PST 2018


ributzka marked 3 inline comments as done.
ributzka added a comment.

I will update the patch with more changes based on the feedback so far.



================
Comment at: llvm/include/llvm/TextAPI/Registry.h:37
+  virtual ~Reader();
+  virtual bool canRead(file_magic Magic, MemoryBufferRef BufferRef,
+                       const Registry &) const = 0;
----------------
jakehehrlich wrote:
> Where is file_magic defined? I'm going to make a bunch of, very possibly wrong, assumptions here.
> 
> Presumably it's computed from MemoryBufferRef as well so requiring the user to pre-compute it is a bit odd. Also not all conceivable formats have magic.
The additions to file_magic are defined in a separate patch (https://reviews.llvm.org/D37820). This is how libObject works if you want to use the generic interface. If you look at the original patch that is attached to the RFC you can see how it all ties together.


https://reviews.llvm.org/D53945





More information about the llvm-commits mailing list