[PATCH] D89279: Support: Add operator== for MemoryBufferRef and split out MemoryBufferRef.h

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 15:52:47 PDT 2020


dexonsmith created this revision.
dexonsmith added reviewers: arphaman, Bigcheese.
Herald added subscribers: ributzka, hiraditya, mgorny.
Herald added a project: LLVM.
dexonsmith requested review of this revision.

As preparation for changing `LineIterator` to work with `MemoryBufferRef`:

- Add an `operator==` that uses buffer pointer identity to ensure two buffers are equivalent.
- Split out `MemoryBufferRef.h`, to avoid polluting `LineIterator.h` includers with everything from `MemoryBuffer.h`. This also means moving the `MemoryBuffer` constructor to a source file.


https://reviews.llvm.org/D89279

Files:
  llvm/include/llvm/Support/MemoryBuffer.h
  llvm/include/llvm/Support/MemoryBufferRef.h
  llvm/lib/Support/CMakeLists.txt
  llvm/lib/Support/MemoryBufferRef.cpp
  llvm/unittests/Support/CMakeLists.txt
  llvm/unittests/Support/MemoryBufferRefTest.cpp
  llvm/unittests/Support/MemoryBufferTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89279.297709.patch
Type: text/x-patch
Size: 7811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201012/c66397c7/attachment-0001.bin>


More information about the llvm-commits mailing list