Skip to content

Commit bdecfeb

Browse files
authored
[OpenMP][NFC] Rename OmptCallback.cpp into OpenMP/OMPT/Callback.cpp (#73813)
Also revert the ifdef OMPT_SUPPORT order to have the short fallback first and not after 400 lines.
1 parent fd2d0bf commit bdecfeb

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

openmp/libomptarget/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ add_llvm_library(omptarget
1919
device.cpp
2020
interface.cpp
2121
omptarget.cpp
22-
OmptCallback.cpp
2322
rtl.cpp
2423
LegacyAPI.cpp
2524
OpenMP/InteropAPI.cpp
25+
OpenMP/OMPT/Callback.cpp
2626

2727
ADDITIONAL_HEADER_DIRS
2828
${LIBOMPTARGET_INCLUDE_DIR}

openmp/libomptarget/src/OmptCallback.cpp renamed to openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- OmptCallback.cpp - Target independent OpenMP target RTL --- C++ -*-===//
1+
//===-- OpenMP/OMPT/Callback.cpp - OpenMP Tooling Callback implementation -===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,9 +10,14 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifdef OMPT_SUPPORT
13+
#ifndef OMPT_SUPPORT
1414

15-
#include "llvm/Support/DynamicLibrary.h"
15+
extern "C" {
16+
/// Dummy definition when OMPT is disabled
17+
void ompt_libomptarget_connect() {}
18+
}
19+
20+
#else // OMPT_SUPPORT is set
1621

1722
#include <cstdlib>
1823
#include <cstring>
@@ -24,6 +29,8 @@
2429
#include "OpenMP/OMPT/Connector.h"
2530
#include "OpenMP/OMPT/Interface.h"
2631

32+
#include "llvm/Support/DynamicLibrary.h"
33+
2734
#undef DEBUG_PREFIX
2835
#define DEBUG_PREFIX "OMPT"
2936

@@ -491,9 +498,4 @@ void ompt_libomptarget_connect(ompt_start_tool_result_t *result) {
491498
DP("Leave ompt_libomptarget_connect\n");
492499
}
493500
}
494-
#else
495-
extern "C" {
496-
/// Dummy definition when OMPT is disabled
497-
void ompt_libomptarget_connect() {}
498-
}
499501
#endif // OMPT_SUPPORT

0 commit comments

Comments
 (0)