[PATCH] D21220: [pdb] Actually write a PDB to the disk

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 11:06:49 PDT 2016


ruiu added inline comments.

================
Comment at: include/llvm/DebugInfo/CodeView/StreamRef.h:96
@@ -93,1 +95,3 @@
 
+  StreamRef &operator=(const StreamRef &Other) {
+    Stream = Other.Stream;
----------------
Is this different from the default copy assignment operator?

================
Comment at: include/llvm/DebugInfo/CodeView/StreamWriter.h:44
@@ -43,2 +43,3 @@
 
-  template <typename T> Error writeObject(const T &Obj) {
+  template <typename T, typename = std::enable_if_t<!std::is_pointer<T>::value>>
+  Error writeObject(const T &Obj) {
----------------
Can you use static_assert instead of enable_if_t?

================
Comment at: include/llvm/DebugInfo/PDB/Raw/PDBFile.h:122
@@ +121,3 @@
+  void setStreamMap(ArrayRef<support::ulittle32_t> Directory,
+                    std::vector<ArrayRef<support::ulittle32_t>> &Streams);
+
----------------
ArrayRef<ArrayRef<support::ulittle32_t>> is probably better for consistency.

================
Comment at: lib/DebugInfo/PDB/Raw/PDBFile.cpp:287
@@ +286,3 @@
+
+Error PDBFile::setSuperBlock(const SuperBlock *Block) {
+  SB = Block;
----------------
We shouldn't meet the error conditions that we are checking in this function unless there's a bug in PDB producer code or YAML reader code (YAML reader should do reasonable semantic checking), so they should be asserts.


http://reviews.llvm.org/D21220





More information about the llvm-commits mailing list