[PATCH] D43341: [clang-doc] Implement reducer portion of the frontend framework

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 27 12:17:21 PDT 2018


lebedev.ri added inline comments.


================
Comment at: clang-doc/BitcodeWriter.h:129
     // Check that the static size is large-enough.
     assert(Record.capacity() > BitCodeConstants::RecordSize);
   }
----------------
juliehockett wrote:
> lebedev.ri wrote:
> > Isn't that the opposite of what was that assert supposed to do?
> > It would have been better to just `// disable` it, and add a `FIXME` note.
> I'm not sure I'm understanding you -- my understanding was that it existed to check that the record size was large enough.
https://reviews.llvm.org/D41102?id=136520#inline-384087
```
#ifndef NDEBUG // Don't want explicit dtor unless needed
~ClangDocBitcodeWriter() {
  // Check that the static size is large-enough.
  assert(Record.capacity() == BitCodeConstants::RecordSize);
}
#endif
```
I.e. it checked that it still only had the static size, and did not transform into normal `vector` with data stored on heap-allocated buffer.


https://reviews.llvm.org/D43341





More information about the cfe-commits mailing list