Files
clang-r547379/include/llvm/ExecutionEngine/Orc/LoadRelocatableObject.h
Ryan Prichard 6024e5c395 Update prebuilt Clang to r547379 (20.0.0).
clang 20.0.0 (based on r547379) from build 12806354.

Bug: http://b/379133546
Test: N/A
Change-Id: I2eb8938af55d809de674be63cb30cf27e801862b

Upstream-Commit: ad834e67b1105d15ef907f6255d4c96e8e733f57
2025-11-26 14:59:46 -05:00

38 lines
1.4 KiB
C++

//===---- LoadRelocatableObject.h - Load relocatable objects ----*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// A wrapper for `MemoryBuffer::getFile` / `MemoryBuffer::getFileSlice` that:
//
// 1. Adds file paths to errors by default.
// 2. Checks architecture compatibility up-front.
// 3. Handles MachO universal binaries, returning the MemoryBuffer for the
// requested slice only.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_EXECUTIONENGINE_ORC_LOADRELOCATABLEOBJECT_H
#define LLVM_EXECUTIONENGINE_ORC_LOADRELOCATABLEOBJECT_H
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/TargetParser/Triple.h"
namespace llvm {
namespace orc {
// Load an object file compatible with the given triple (if given) from the
// given path. May return a file slice if the path contains a universal binary.
Expected<std::unique_ptr<MemoryBuffer>> loadRelocatableObject(
StringRef Path, const Triple &TT,
std::optional<StringRef> IdentifierOverride = std::nullopt);
} // End namespace orc
} // End namespace llvm
#endif // LLVM_EXECUTIONENGINE_ORC_LOADRELOCATABLEOBJECT_H