Path: blob/main/contrib/llvm-project/llvm/lib/ObjCopy/wasm/WasmObject.cpp
35266 views
//===- WasmObject.cpp -----------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "WasmObject.h"910#include "llvm/Support/LEB128.h"11#include "llvm/Support/raw_ostream.h"1213namespace llvm {14namespace objcopy {15namespace wasm {1617using namespace object;18using namespace llvm::wasm;1920void Object::addSectionWithOwnedContents(21Section NewSection, std::unique_ptr<MemoryBuffer> &&Content) {22Sections.push_back(NewSection);23OwnedContents.emplace_back(std::move(Content));24}2526void Object::removeSections(function_ref<bool(const Section &)> ToRemove) {27// TODO: remove reloc sections for the removed section, handle symbols, etc.28llvm::erase_if(Sections, ToRemove);29}3031} // end namespace wasm32} // end namespace objcopy33} // end namespace llvm343536