[PATCH] D21157: [pdb] Improve StreamInterface to support writing

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 17:46:42 PDT 2016


ruiu added a comment.

If you like the readable and writable streams, I don't have a strong opinion to oppose it, since I don't really understand the need here.

But it is a bit concerning that the use case you wrote are currently all hypothetical, and we are writing relatively complex code particularly for cache consistency. Do we need to update the cached entries? It might be a good property to guarantee, but we may be able to just say that "when you write something to a stream, all data objects you read before are invalid now -- so don't use it or read it again." It's hard for me to imagine a use case in which you read, write and read some data again and again from/to the same stream. Even if you need it in future, you can add it when it is needed, no?


================
Comment at: include/llvm/DebugInfo/CodeView/StreamWriter.h:32-33
@@ +31,4 @@
+  Error writeBytes(ArrayRef<uint8_t> Buffer);
+  Error writeInteger(uint16_t Dest);
+  Error writeInteger(uint32_t Dest);
+  Error writeZeroString(StringRef Str);
----------------
I'd like to name them writeUint{16,32} instead of defining as a overloaded function. Sometimes argument type is not obvious in a local context (uses of `auto` makes it much harder).


http://reviews.llvm.org/D21157





More information about the llvm-commits mailing list