llvm/openmp/runtime/src/kmp_error.cpp

/*
 * kmp_error.cpp -- KPTS functions for error checking at runtime
 */

//===----------------------------------------------------------------------===//
//
// 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 "kmp.h"
#include "kmp_error.h"
#include "kmp_i18n.h"
#include "kmp_str.h"

/* ------------------------------------------------------------------------ */

#define MIN_STACK

static char const *cons_text_c[] =;

#define get_src(ident)

#define PUSH_MSG(ct, ident)
#define POP_MSG(p)

static int const cons_text_c_num =;

/* --------------- START OF STATIC LOCAL ROUTINES ------------------------- */

static void __kmp_check_null_func(void) {}

static void __kmp_expand_cons_stack(int gtid, struct cons_header *p) {}

// NOTE: Function returns allocated memory, caller must free it!
static char *__kmp_pragma(int ct, ident_t const *ident) {} // __kmp_pragma

/* ----------------- END OF STATIC LOCAL ROUTINES ------------------------- */

void __kmp_error_construct(kmp_i18n_id_t id, // Message identifier.
                           enum cons_type ct, // Construct type.
                           ident_t const *ident // Construct ident.
) {}

void __kmp_error_construct2(kmp_i18n_id_t id, // Message identifier.
                            enum cons_type ct, // First construct type.
                            ident_t const *ident, // First construct ident.
                            struct cons_data const *cons // Second construct.
) {}

struct cons_header *__kmp_allocate_cons_stack(int gtid) {}

void __kmp_free_cons_stack(void *ptr) {}

#if KMP_DEBUG
static void dump_cons_stack(int gtid, struct cons_header *p) {
  int i;
  int tos = p->stack_top;
  kmp_str_buf_t buffer;
  __kmp_str_buf_init(&buffer);
  __kmp_str_buf_print(
      &buffer,
      "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n");
  __kmp_str_buf_print(&buffer,
                      "Begin construct stack with %d items for thread %d\n",
                      tos, gtid);
  __kmp_str_buf_print(&buffer, "     stack_top=%d { P=%d, W=%d, S=%d }\n", tos,
                      p->p_top, p->w_top, p->s_top);
  for (i = tos; i > 0; i--) {
    struct cons_data *c = &(p->stack_data[i]);
    __kmp_str_buf_print(
        &buffer, "        stack_data[%2d] = { %s (%s) %d %p }\n", i,
        cons_text_c[c->type], get_src(c->ident), c->prev, c->name);
  }
  __kmp_str_buf_print(&buffer, "End construct stack for thread %d\n", gtid);
  __kmp_str_buf_print(
      &buffer,
      "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n");
  __kmp_debug_printf("%s", buffer.str);
  __kmp_str_buf_free(&buffer);
}
#endif

void __kmp_push_parallel(int gtid, ident_t const *ident) {}

void __kmp_check_workshare(int gtid, enum cons_type ct, ident_t const *ident) {}

void __kmp_push_workshare(int gtid, enum cons_type ct, ident_t const *ident) {}

void
#if KMP_USE_DYNAMIC_LOCK
__kmp_check_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_lock_p lck, kmp_uint32 seq )
#else
__kmp_check_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_lock_p lck )
#endif
{}

void
#if KMP_USE_DYNAMIC_LOCK
__kmp_push_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_lock_p lck, kmp_uint32 seq )
#else
__kmp_push_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_lock_p lck )
#endif
{}

/* ------------------------------------------------------------------------ */

void __kmp_pop_parallel(int gtid, ident_t const *ident) {}

enum cons_type __kmp_pop_workshare(int gtid, enum cons_type ct,
                                   ident_t const *ident) {}

void __kmp_pop_sync(int gtid, enum cons_type ct, ident_t const *ident) {}

/* ------------------------------------------------------------------------ */

void __kmp_check_barrier(int gtid, enum cons_type ct, ident_t const *ident) {}