Skip to content

Commit 9c9d4b9

Browse files
committed
[ORC] Move ostream operator for SymbolStringPtrBase into OrcShared.
This will allow clients outside ORC (e.g. JITLink) to use the operator without taking a dependence on ORC.
1 parent 109e4a1 commit 9c9d4b9

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

llvm/lib/ExecutionEngine/Orc/Core.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ char LookupTask::ID = 0;
3838
RegisterDependenciesFunction NoDependenciesToRegister =
3939
RegisterDependenciesFunction();
4040

41-
raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPtrBase &Sym) {
42-
return (OS << Sym.S->first());
43-
}
44-
4541
void MaterializationUnit::anchor() {}
4642

4743
ResourceTracker::ResourceTracker(JITDylibSP JD) {

llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ add_llvm_component_library(LLVMOrcShared
55
OrcError.cpp
66
OrcRTBridge.cpp
77
SimpleRemoteEPCUtils.cpp
8+
SymbolStringPool.cpp
89
ADDITIONAL_HEADER_DIRS
910
${LLVM_MAIN_INCLUDE_DIR}/llvm/ExecutionEngine/Orc
1011

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===------- SymbolStringPool.cpp - SymbolStringPool implementation -------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "llvm/ExecutionEngine/Orc/SymbolStringPool.h"
10+
#include "llvm/Support/raw_ostream.h"
11+
12+
namespace llvm::orc {
13+
14+
raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPtrBase &Sym) {
15+
return OS << Sym.S->first();
16+
}
17+
18+
} // namespace llvm::orc

0 commit comments

Comments
 (0)