mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
b7c96281d2
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. Differential Revision: https://reviews.llvm.org/D89279
20 lines
757 B
C++
20 lines
757 B
C++
//===- MemoryBufferRef.cpp - Memory Buffer Reference ----------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file implements the MemoryBufferRef interface.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/Support/MemoryBufferRef.h"
|
|
#include "llvm/Support/MemoryBuffer.h"
|
|
|
|
using namespace llvm;
|
|
|
|
MemoryBufferRef::MemoryBufferRef(const MemoryBuffer &Buffer)
|
|
: Buffer(Buffer.getBuffer()), Identifier(Buffer.getBufferIdentifier()) {}
|