Skip to content

Commit

Permalink
[OpenMP][NFC] Rename OmptCallback.cpp into OpenMP/OMPT/Callback.cpp (#…
Browse files Browse the repository at this point in the history
…73813)

Also revert the ifdef OMPT_SUPPORT order to have the short fallback
first and not after 400 lines.
  • Loading branch information
jdoerfert committed Nov 29, 2023
1 parent fd2d0bf commit bdecfeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion openmp/libomptarget/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ add_llvm_library(omptarget
device.cpp
interface.cpp
omptarget.cpp
OmptCallback.cpp
rtl.cpp
LegacyAPI.cpp
OpenMP/InteropAPI.cpp
OpenMP/OMPT/Callback.cpp

ADDITIONAL_HEADER_DIRS
${LIBOMPTARGET_INCLUDE_DIR}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- OmptCallback.cpp - Target independent OpenMP target RTL --- C++ -*-===//
//===-- OpenMP/OMPT/Callback.cpp - OpenMP Tooling Callback implementation -===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -10,9 +10,14 @@
//
//===----------------------------------------------------------------------===//

#ifdef OMPT_SUPPORT
#ifndef OMPT_SUPPORT

#include "llvm/Support/DynamicLibrary.h"
extern "C" {
/// Dummy definition when OMPT is disabled
void ompt_libomptarget_connect() {}
}

#else // OMPT_SUPPORT is set

#include <cstdlib>
#include <cstring>
Expand All @@ -24,6 +29,8 @@
#include "OpenMP/OMPT/Connector.h"
#include "OpenMP/OMPT/Interface.h"

#include "llvm/Support/DynamicLibrary.h"

#undef DEBUG_PREFIX
#define DEBUG_PREFIX "OMPT"

Expand Down Expand Up @@ -491,9 +498,4 @@ void ompt_libomptarget_connect(ompt_start_tool_result_t *result) {
DP("Leave ompt_libomptarget_connect\n");
}
}
#else
extern "C" {
/// Dummy definition when OMPT is disabled
void ompt_libomptarget_connect() {}
}
#endif // OMPT_SUPPORT

0 comments on commit bdecfeb

Please sign in to comment.