[OpenMP][NFC] Move Environment.h and SourceInfo.h into "Shared" folder (#73703)

GitOrigin-RevId: 7233e42dff7f819d76baeb67781648718828e026
diff --git a/libomptarget/DeviceRTL/include/Configuration.h b/libomptarget/DeviceRTL/include/Configuration.h
index 45e5cea..c9f8f25 100644
--- a/libomptarget/DeviceRTL/include/Configuration.h
+++ b/libomptarget/DeviceRTL/include/Configuration.h
@@ -13,7 +13,8 @@
 #ifndef OMPTARGET_CONFIGURATION_H
 #define OMPTARGET_CONFIGURATION_H
 
-#include "Environment.h"
+#include "Shared/Environment.h"
+
 #include "Types.h"
 
 namespace ompx {
diff --git a/libomptarget/DeviceRTL/include/Interface.h b/libomptarget/DeviceRTL/include/Interface.h
index 54c3b3a..f4854ed 100644
--- a/libomptarget/DeviceRTL/include/Interface.h
+++ b/libomptarget/DeviceRTL/include/Interface.h
@@ -12,7 +12,8 @@
 #ifndef OMPTARGET_DEVICERTL_INTERFACE_H
 #define OMPTARGET_DEVICERTL_INTERFACE_H
 
-#include "Environment.h"
+#include "Shared/Environment.h"
+
 #include "Types.h"
 
 /// External API
diff --git a/libomptarget/DeviceRTL/include/State.h b/libomptarget/DeviceRTL/include/State.h
index 1d73bdc..c93de41 100644
--- a/libomptarget/DeviceRTL/include/State.h
+++ b/libomptarget/DeviceRTL/include/State.h
@@ -12,8 +12,9 @@
 #ifndef OMPTARGET_STATE_H
 #define OMPTARGET_STATE_H
 
+#include "Shared/Environment.h"
+
 #include "Debug.h"
-#include "Environment.h"
 #include "Mapping.h"
 #include "Types.h"
 #include "Utils.h"
diff --git a/libomptarget/DeviceRTL/src/Allocator.cpp b/libomptarget/DeviceRTL/src/Allocator.cpp
index 7a4cbfe..c9c940d 100644
--- a/libomptarget/DeviceRTL/src/Allocator.cpp
+++ b/libomptarget/DeviceRTL/src/Allocator.cpp
@@ -8,9 +8,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "Shared/Environment.h"
+
 #include "Allocator.h"
 #include "Configuration.h"
-#include "Environment.h"
 #include "Mapping.h"
 #include "Synchronization.h"
 #include "Types.h"
diff --git a/libomptarget/DeviceRTL/src/Debug.cpp b/libomptarget/DeviceRTL/src/Debug.cpp
index dd627fc..aecc33c 100644
--- a/libomptarget/DeviceRTL/src/Debug.cpp
+++ b/libomptarget/DeviceRTL/src/Debug.cpp
@@ -10,9 +10,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Debug.h"
+#include "Shared/Environment.h"
+
 #include "Configuration.h"
-#include "Environment.h"
+#include "Debug.h"
 #include "Interface.h"
 #include "Mapping.h"
 #include "State.h"
diff --git a/libomptarget/DeviceRTL/src/Kernel.cpp b/libomptarget/DeviceRTL/src/Kernel.cpp
index f7d8ff8..06b12fe 100644
--- a/libomptarget/DeviceRTL/src/Kernel.cpp
+++ b/libomptarget/DeviceRTL/src/Kernel.cpp
@@ -10,9 +10,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "Shared/Environment.h"
+
 #include "Allocator.h"
 #include "Debug.h"
-#include "Environment.h"
 #include "Interface.h"
 #include "Mapping.h"
 #include "State.h"
diff --git a/libomptarget/DeviceRTL/src/State.cpp b/libomptarget/DeviceRTL/src/State.cpp
index f8a6d33..40f99e0 100644
--- a/libomptarget/DeviceRTL/src/State.cpp
+++ b/libomptarget/DeviceRTL/src/State.cpp
@@ -8,14 +8,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "State.h"
+#include "Shared/Environment.h"
+
 #include "Allocator.h"
 #include "Configuration.h"
 #include "Debug.h"
-#include "Environment.h"
 #include "Interface.h"
 #include "LibC.h"
 #include "Mapping.h"
+#include "State.h"
 #include "Synchronization.h"
 #include "Types.h"
 #include "Utils.h"
diff --git a/libomptarget/include/Environment.h b/libomptarget/include/Shared/Environment.h
similarity index 94%
rename from libomptarget/include/Environment.h
rename to libomptarget/include/Shared/Environment.h
index 3f3dce6..d141146 100644
--- a/libomptarget/include/Environment.h
+++ b/libomptarget/include/Shared/Environment.h
@@ -1,4 +1,4 @@
-//===------------ Environment.h - OpenMP GPU environments --------- C++ -*-===//
+//===-- Shared/Environment.h - OpenMP GPU environments ------------ C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _OMPTARGET_ENVIRONMENT_H_
-#define _OMPTARGET_ENVIRONMENT_H_
+#ifndef OMPTARGET_SHARED_ENVIRONMENT_H
+#define OMPTARGET_SHARED_ENVIRONMENT_H
 
 #ifdef OMPTARGET_DEVICE_RUNTIME
 #include "Types.h"
@@ -105,4 +105,4 @@
   void *ReductionBuffer = nullptr;
 };
 
-#endif // _OMPTARGET_ENVIRONMENT_H_
+#endif // OMPTARGET_SHARED_ENVIRONMENT_H
diff --git a/libomptarget/include/SourceInfo.h b/libomptarget/include/Shared/SourceInfo.h
similarity index 94%
rename from libomptarget/include/SourceInfo.h
rename to libomptarget/include/Shared/SourceInfo.h
index d508f6d..7ce5fd4 100644
--- a/libomptarget/include/SourceInfo.h
+++ b/libomptarget/include/Shared/SourceInfo.h
@@ -1,4 +1,4 @@
-//===------- SourceInfo.h - Target independent OpenMP target RTL -- C++ -*-===//
+//===-- SharedSourceInfo.h - Target independent OpenMP target RTL - C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _SOURCE_INFO_H_
-#define _SOURCE_INFO_H_
+#ifndef OMPTARGET_SHARED_SOURCE_INFO_H
+#define OMPTARGET_SHARED_SOURCE_INFO_H
 
 #include <string>
 
@@ -110,4 +110,4 @@
   return NameStr.substr(Begin + 1, End - Begin - 1);
 }
 
-#endif
+#endif // OMPTARGET_SHARED_SOURCE_INFO_H
diff --git a/libomptarget/include/omptarget.h b/libomptarget/include/omptarget.h
index 19e072a..d1c908e 100644
--- a/libomptarget/include/omptarget.h
+++ b/libomptarget/include/omptarget.h
@@ -14,7 +14,8 @@
 #ifndef _OMPTARGET_H_
 #define _OMPTARGET_H_
 
-#include "Environment.h"
+#include "Shared/Environment.h"
+#include "Shared/SourceInfo.h"
 
 #include <cstdint>
 #include <deque>
@@ -23,8 +24,6 @@
 #include <stdint.h>
 #include <type_traits>
 
-#include <SourceInfo.h>
-
 #include "llvm/ADT/SmallVector.h"
 
 #define OFFLOAD_SUCCESS (0)
diff --git a/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
index da3d281..8b22941 100644
--- a/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -21,9 +21,9 @@
 #include <unordered_map>
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 #include "Shared/Utils.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "OmptCallback.h"
 #include "PluginInterface.h"
diff --git a/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp b/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
index 277aab1..3b0b7de 100644
--- a/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
+++ b/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
@@ -11,8 +11,8 @@
 #include "PluginInterface.h"
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "JIT.h"
 #include "Utils/ELF.h"
diff --git a/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h b/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
index 23e2e1e..6abd1b6 100644
--- a/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
+++ b/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
@@ -20,9 +20,9 @@
 #include <vector>
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 #include "Shared/Utils.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "JIT.h"
 #include "MemoryManager.h"
diff --git a/libomptarget/plugins-nextgen/cuda/src/rtl.cpp b/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
index fc2ef54..97e49ad 100644
--- a/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
+++ b/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
@@ -17,8 +17,8 @@
 #include <unordered_map>
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "OmptCallback.h"
 #include "PluginInterface.h"
diff --git a/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp b/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp
index ce5f2f0..c0107c1 100644
--- a/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp
+++ b/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp
@@ -17,8 +17,8 @@
 #include <unordered_map>
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "OmptCallback.h"
 #include "PluginInterface.h"
diff --git a/libomptarget/src/private.h b/libomptarget/src/private.h
index 87ffe2d..37dae0a 100644
--- a/libomptarget/src/private.h
+++ b/libomptarget/src/private.h
@@ -14,8 +14,8 @@
 #define _OMPTARGET_PRIVATE_H
 
 #include "Shared/Debug.h"
+#include "Shared/SourceInfo.h"
 
-#include "SourceInfo.h"
 #include "device.h"
 #include "omptarget.h"