/* * TargetValue.h -- Access to target values using OMPD callbacks */ //===----------------------------------------------------------------------===// // // 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 // //===----------------------------------------------------------------------===// #include "omp-tools.h" #include "ompd-private.h" #include <stdlib.h> #ifndef SRC_TARGET_VALUE_H_ #define SRC_TARGET_VALUE_H_ #ifdef __cplusplus #include <cassert> #include <map> #include <string> class TType; class TValue; class TBaseValue; class TTypeFactory { … }; static thread_local TTypeFactory tf = …; class TType { … }; static TType nullType(true); /** * class TError * As TValue is designed to concatenate operations, we use TError * to catch errors that might happen on each operation and provide * the according error code and which operation raised the error. */ class TError { … }; /** * class TValue * This class encapsules the access to target values by using OMPD * callback functions. The member functions are designed to concatenate * the operations that are needed to access values from structures * e.g., _a[6]->_b._c would read like : * TValue(ctx, * "_a").cast("A",2).getArrayElement(6).access("_b").cast("B").access("_c") */ class TValue { … }; class TBaseValue : public TValue { … }; template <typename T> ompd_rc_t TBaseValue::getValue(T &buf) { … } #define EXTERN_C … #else #define EXTERN_C #endif #endif /*SRC_TARGET_VALUE_H_*/