Skip to content

Commit 3e04ad4

Browse files
committed
[ORC-RT] Remove double underscore from the orc_rt namespace.
We should use `orc_rt` as the public C++ API namespace for the ORC runtime and control symbol visibility to hide implementation details, rather than rely on the '__' prefix.
1 parent d5f6f30 commit 3e04ad4

24 files changed

+64
-67
lines changed

compiler-rt/lib/orc/adt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <ostream>
1919
#include <string>
2020

21-
namespace __orc_rt {
21+
namespace orc_rt {
2222

2323
constexpr std::size_t dynamic_extent = std::numeric_limits<std::size_t>::max();
2424

@@ -58,6 +58,6 @@ template <typename T, std::size_t Extent = dynamic_extent> class span {
5858
size_type Size = 0;
5959
};
6060

61-
} // end namespace __orc_rt
61+
} // namespace orc_rt
6262

6363
#endif // ORC_RT_ADT_H

compiler-rt/lib/orc/bitmask_enum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <cassert>
1919
#include <type_traits>
2020

21-
namespace __orc_rt {
21+
namespace orc_rt {
2222

2323
/// ORC_RT_MARK_AS_BITMASK_ENUM lets you opt in an individual enum type so you
2424
/// can perform bitwise operations on it without putting static_cast everywhere.
@@ -146,6 +146,6 @@ E &operator^=(E &LHS, E RHS) {
146146
return LHS;
147147
}
148148

149-
} // end namespace __orc_rt
149+
} // namespace orc_rt
150150

151151
#endif // ORC_RT_BITMASK_ENUM_H

compiler-rt/lib/orc/coff_platform.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030
#define DEBUG_TYPE "coff_platform"
3131

32-
using namespace __orc_rt;
32+
using namespace orc_rt;
3333

34-
namespace __orc_rt {
34+
namespace orc_rt {
3535

3636
using COFFJITDylibDepInfo = std::vector<ExecutorAddr>;
3737
using COFFJITDylibDepInfoMap =
@@ -45,7 +45,7 @@ using SPSCOFFJITDylibDepInfo = SPSSequence<SPSExecutorAddr>;
4545
using SPSCOFFJITDylibDepInfoMap =
4646
SPSSequence<SPSTuple<SPSExecutorAddr, SPSCOFFJITDylibDepInfo>>;
4747

48-
} // namespace __orc_rt
48+
} // namespace orc_rt
4949

5050
ORC_RT_JIT_DISPATCH_TAG(__orc_rt_coff_symbol_lookup_tag)
5151
ORC_RT_JIT_DISPATCH_TAG(__orc_rt_coff_push_initializers_tag)
@@ -752,7 +752,7 @@ ORC_RT_INTERFACE int64_t __orc_rt_coff_run_program(const char *JITDylibName,
752752
using MainTy = int (*)(int, char *[]);
753753

754754
void *H =
755-
__orc_rt_coff_jit_dlopen(JITDylibName, __orc_rt::coff::ORC_RT_RTLD_LAZY);
755+
__orc_rt_coff_jit_dlopen(JITDylibName, orc_rt::coff::ORC_RT_RTLD_LAZY);
756756
if (!H) {
757757
__orc_rt_log_error(__orc_rt_coff_jit_dlerror());
758758
return -1;

compiler-rt/lib/orc/coff_platform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ORC_RT_INTERFACE int __orc_rt_coff_jit_dlclose(void *header);
2323
ORC_RT_INTERFACE void *__orc_rt_coff_jit_dlsym(void *header,
2424
const char *symbol);
2525

26-
namespace __orc_rt {
26+
namespace orc_rt {
2727
namespace coff {
2828

2929
enum dlopen_mode : int {
@@ -33,7 +33,7 @@ enum dlopen_mode : int {
3333
ORC_RT_RTLD_GLOBAL = 0x8
3434
};
3535

36-
} // end namespace coff
37-
} // end namespace __orc_rt
36+
} // namespace coff
37+
} // namespace orc_rt
3838

3939
#endif

compiler-rt/lib/orc/debug.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
#include <cstdlib>
1919
#include <cstring>
2020

21-
22-
namespace __orc_rt {
21+
namespace orc_rt {
2322

2423
#ifndef NDEBUG
2524

@@ -80,4 +79,4 @@ void printdbg(const char *format, ...) {
8079

8180
#endif // !NDEBUG
8281

83-
} // end namespace __orc_rt
82+
} // namespace orc_rt

compiler-rt/lib/orc/debug.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#ifndef NDEBUG
1919

20-
namespace __orc_rt {
20+
namespace orc_rt {
2121

2222
extern std::atomic<const char *> DebugTypes;
2323
extern char DebugTypesAll;
@@ -27,18 +27,16 @@ const char *initializeDebug();
2727
bool debugTypeEnabled(const char *Type, const char *Types);
2828
void printdbg(const char *format, ...);
2929

30-
} // namespace __orc_rt
30+
} // namespace orc_rt
3131

3232
#define ORC_RT_DEBUG_WITH_TYPE(TYPE, X) \
3333
do { \
34-
const char *Types = \
35-
::__orc_rt::DebugTypes.load(std::memory_order_relaxed); \
34+
const char *Types = ::orc_rt::DebugTypes.load(std::memory_order_relaxed); \
3635
if (!Types) \
3736
Types = initializeDebug(); \
3837
if (Types == &DebugTypesNone) \
3938
break; \
40-
if (Types == &DebugTypesAll || \
41-
::__orc_rt::debugTypeEnabled(TYPE, Types)) { \
39+
if (Types == &DebugTypesAll || ::orc_rt::debugTypeEnabled(TYPE, Types)) { \
4240
X; \
4341
} \
4442
} while (false)

compiler-rt/lib/orc/dlfcn_wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <vector>
1818

19-
using namespace __orc_rt;
19+
using namespace orc_rt;
2020

2121
extern "C" const char *__orc_rt_jit_dlerror();
2222
extern "C" void *__orc_rt_jit_dlopen(const char *path, int mode);

compiler-rt/lib/orc/elfnix_platform.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include <unordered_map>
2525
#include <vector>
2626

27-
using namespace __orc_rt;
28-
using namespace __orc_rt::elfnix;
27+
using namespace orc_rt;
28+
using namespace orc_rt::elfnix;
2929

3030
// Declare function tags for functions in the JIT process.
3131
ORC_RT_JIT_DISPATCH_TAG(__orc_rt_elfnix_get_initializers_tag)
@@ -601,7 +601,7 @@ ORC_RT_INTERFACE int64_t __orc_rt_elfnix_run_program(
601601
using MainTy = int (*)(int, char *[]);
602602

603603
void *H = __orc_rt_elfnix_jit_dlopen(JITDylibName,
604-
__orc_rt::elfnix::ORC_RT_RTLD_LAZY);
604+
orc_rt::elfnix::ORC_RT_RTLD_LAZY);
605605
if (!H) {
606606
__orc_rt_log_error(__orc_rt_elfnix_jit_dlerror());
607607
return -1;

compiler-rt/lib/orc/elfnix_platform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ORC_RT_INTERFACE int __orc_rt_elfnix_jit_dlclose(void *dso_handle);
2929
ORC_RT_INTERFACE void *__orc_rt_elfnix_jit_dlsym(void *dso_handle,
3030
const char *symbol);
3131

32-
namespace __orc_rt {
32+
namespace orc_rt {
3333
namespace elfnix {
3434

3535
struct ELFNixPerObjectSectionsToRegister {
@@ -65,7 +65,7 @@ enum dlopen_mode : int {
6565
ORC_RT_RTLD_GLOBAL = 0x8
6666
};
6767

68-
} // end namespace elfnix
68+
} // namespace elfnix
6969

7070
using SPSELFNixPerObjectSectionsToRegister =
7171
SPSTuple<SPSExecutorAddrRange, SPSExecutorAddrRange>;
@@ -126,6 +126,6 @@ class SPSSerializationTraits<SPSELFNixJITDylibInitializers,
126126
}
127127
};
128128

129-
} // end namespace __orc_rt
129+
} // namespace orc_rt
130130

131131
#endif // ORC_RT_ELFNIX_PLATFORM_H

compiler-rt/lib/orc/endianness.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#endif
4747
#endif
4848

49-
namespace __orc_rt {
49+
namespace orc_rt {
5050

5151
/// ByteSwap_16 - This function returns a byte-swapped representation of
5252
/// the 16-bit argument.
@@ -138,6 +138,6 @@ template <typename T> inline void swapByteOrder(T &Value) {
138138
Value = getSwappedBytes(Value);
139139
}
140140

141-
} // end namespace __orc_rt
141+
} // namespace orc_rt
142142

143143
#endif // ORC_RT_ENDIAN_H

0 commit comments

Comments
 (0)