[PATCH] D46205: Set MemoryBuffer's RequiresNullTerminator to false by default.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 09:38:08 PDT 2018


ruiu added inline comments.


================
Comment at: clang/tools/clang-refactor/TestSupport.cpp:297
   ErrorOr<std::unique_ptr<MemoryBuffer>> ErrOrFile =
-      MemoryBuffer::getFile(Filename);
   if (!ErrOrFile) {
----------------
espindola wrote:
> Maybe we should have a getNullTerminatedFile?
I tried that but it seems it is better to do it incrementally. MemoryBuffer functions are used at a lot of places in LLVM and doing multiple changes in the same patch isn't easy. So let me submit this patch first.


================
Comment at: llvm/unittests/AsmParser/AsmParserTest.cpp:36
-
-TEST(AsmParserTest, NonNullTerminatedInput) {
-  LLVMContext Ctx;
----------------
espindola wrote:
> Why delete this test?
Because this test doesn't pass with this patch and what this test is testing doesn't make sense. It verifies that the asm parser dies with an assertion failure if an input is not \0-terminated, but the asm parser doesn't actually requires the terminator. It works fine without it.


https://reviews.llvm.org/D46205





More information about the llvm-commits mailing list