[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.
This commit is contained in:
Lang Hames
2024-12-04 16:35:31 +11:00
parent 109e4a147f
commit 9c9d4b9e73
3 changed files with 19 additions and 4 deletions

View File

@@ -38,10 +38,6 @@ char LookupTask::ID = 0;
RegisterDependenciesFunction NoDependenciesToRegister =
RegisterDependenciesFunction();
raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPtrBase &Sym) {
return (OS << Sym.S->first());
}
void MaterializationUnit::anchor() {}
ResourceTracker::ResourceTracker(JITDylibSP JD) {

View File

@@ -5,6 +5,7 @@ add_llvm_component_library(LLVMOrcShared
OrcError.cpp
OrcRTBridge.cpp
SimpleRemoteEPCUtils.cpp
SymbolStringPool.cpp
ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/ExecutionEngine/Orc

View File

@@ -0,0 +1,18 @@
//===------- SymbolStringPool.cpp - SymbolStringPool implementation -------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "llvm/ExecutionEngine/Orc/SymbolStringPool.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm::orc {
raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPtrBase &Sym) {
return OS << Sym.S->first();
}
} // namespace llvm::orc