Files
Alex Duran 525b9ff127 [Offload][Omp][Acc][NFC] Restructure offload directory (#242220)
Create a src and include directory for libomptarget and libompaccsupport
following the same structure as liboffload.

Move headers from the base include directory to the directories that use
them.

Just a few utility headers remain in the share base include/Shared
directory. Of those, Environment.h and RPCOpcodes.h seem questionable
but seem in used in both the plugins and libomptarget (which seems to
point to further refactoring needed).

Changes in source files are basically due to directory changes, leftover
headers, and in a few cases, changing headers that were only used
transitively for their own dependence.

Headers in libompaccsupport seem like they could be further refined as
they contain both shared and things only neeeded by libomptarget, but
that's a larger refactoring to be done later.

Mechanical work done by Claude.
2026-11-17 10:29:55 +01:00

48 lines
1.4 KiB
C++

//===-- OffloadEntry.h - Representation of offload entries ------*- 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
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
#ifndef OMPTARGET_OFFLOAD_ENTRY_H
#define OMPTARGET_OFFLOAD_ENTRY_H
#include "APITypes.h"
#include "omptarget.h"
#include "llvm/ADT/StringRef.h"
class DeviceImageTy;
class OffloadEntryTy {
DeviceImageTy &DeviceImage;
llvm::offloading::EntryTy &OffloadEntry;
public:
OffloadEntryTy(DeviceImageTy &DeviceImage,
llvm::offloading::EntryTy &OffloadEntry)
: DeviceImage(DeviceImage), OffloadEntry(OffloadEntry) {}
bool isGlobal() const { return getSize() != 0; }
size_t getSize() const { return OffloadEntry.Size; }
void *getnAddress() const { return OffloadEntry.Address; }
llvm::StringRef getName() const { return OffloadEntry.SymbolName; }
const char *getNameAsCStr() const { return OffloadEntry.SymbolName; }
__tgt_bin_desc *getBinaryDescription() const;
bool isLink() const { return hasFlags(OMP_DECLARE_TARGET_LINK); }
bool hasFlags(OpenMPOffloadingDeclareTargetFlags Flags) const {
return Flags & OffloadEntry.Flags;
}
};
#endif // OMPTARGET_OFFLOAD_ENTRY_H