diff options
Diffstat (limited to 'tools/llvm-objcopy/Buffer.h')
-rw-r--r-- | tools/llvm-objcopy/Buffer.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/llvm-objcopy/Buffer.h b/tools/llvm-objcopy/Buffer.h index e5b9c5b2d22b..487d5585c364 100644 --- a/tools/llvm-objcopy/Buffer.h +++ b/tools/llvm-objcopy/Buffer.h @@ -1,9 +1,8 @@ //===- Buffer.h -------------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// 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 // //===----------------------------------------------------------------------===// @@ -28,7 +27,7 @@ class Buffer { public: virtual ~Buffer(); - virtual void allocate(size_t Size) = 0; + virtual Error allocate(size_t Size) = 0; virtual uint8_t *getBufferStart() = 0; virtual Error commit() = 0; @@ -38,9 +37,12 @@ public: class FileBuffer : public Buffer { std::unique_ptr<FileOutputBuffer> Buf; + // Indicates that allocate(0) was called, and commit() should create or + // truncate a file instead of using a FileOutputBuffer. + bool EmptyFile = false; public: - void allocate(size_t Size) override; + Error allocate(size_t Size) override; uint8_t *getBufferStart() override; Error commit() override; @@ -51,7 +53,7 @@ class MemBuffer : public Buffer { std::unique_ptr<WritableMemoryBuffer> Buf; public: - void allocate(size_t Size) override; + Error allocate(size_t Size) override; uint8_t *getBufferStart() override; Error commit() override; |