[llvm] r335661 - [ORC] Fix a FIXME by moving MangleAndInterner to Core.h.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 26 13:59:46 PDT 2018
Author: lhames
Date: Tue Jun 26 13:59:46 2018
New Revision: 335661
URL: http://llvm.org/viewvc/llvm-project?rev=335661&view=rev
Log:
[ORC] Fix a FIXME by moving MangleAndInterner to Core.h.
Modified:
llvm/trunk/include/llvm/ExecutionEngine/Orc/Core.h
llvm/trunk/include/llvm/ExecutionEngine/Orc/Layer.h
llvm/trunk/lib/ExecutionEngine/Orc/Core.cpp
llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/Core.h?rev=335661&r1=335660&r2=335661&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/Core.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/Core.h Tue Jun 26 13:59:46 2018
@@ -701,6 +701,18 @@ Expected<SymbolMap> lookup(const VSO::VS
Expected<JITEvaluatedSymbol> lookup(const VSO::VSOList &VSOs,
SymbolStringPtr Name);
+/// Mangles symbol names then uniques them in the context of an
+/// ExecutionSession.
+class MangleAndInterner {
+public:
+ MangleAndInterner(ExecutionSessionBase &ES, const DataLayout &DL);
+ SymbolStringPtr operator()(StringRef Name);
+
+private:
+ ExecutionSessionBase &ES;
+ const DataLayout &DL;
+};
+
} // End namespace orc
} // End namespace llvm
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/Layer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/Layer.h?rev=335661&r1=335660&r2=335661&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/Layer.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/Layer.h Tue Jun 26 13:59:46 2018
@@ -20,19 +20,6 @@
namespace llvm {
namespace orc {
-/// Mangles symbol names then uniques them in the context of an
-/// ExecutionSession.
-//
-// FIXME: This may be more at home in Core.h.
-class MangleAndInterner {
-public:
- MangleAndInterner(ExecutionSession &ES, const DataLayout &DL);
- SymbolStringPtr operator()(StringRef Name);
-private:
- ExecutionSession &ES;
- const DataLayout &DL;
-};
-
/// Interface for layers that accept LLVM IR.
class IRLayer {
public:
Modified: llvm/trunk/lib/ExecutionEngine/Orc/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/Core.cpp?rev=335661&r1=335660&r2=335661&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/Core.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/Core.cpp Tue Jun 26 13:59:46 2018
@@ -10,6 +10,7 @@
#include "llvm/ExecutionEngine/Orc/Core.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/ExecutionEngine/Orc/OrcError.h"
+#include "llvm/IR/Mangler.h"
#include "llvm/Support/Format.h"
#if LLVM_ENABLE_THREADS
@@ -1208,5 +1209,18 @@ Expected<JITEvaluatedSymbol> lookup(cons
return ResultMap.takeError();
}
+MangleAndInterner::MangleAndInterner(ExecutionSessionBase &ES,
+ const DataLayout &DL)
+ : ES(ES), DL(DL) {}
+
+SymbolStringPtr MangleAndInterner::operator()(StringRef Name) {
+ std::string MangledName;
+ {
+ raw_string_ostream MangledNameStream(MangledName);
+ Mangler::getNameWithPrefix(MangledNameStream, Name, DL);
+ }
+ return ES.getSymbolStringPool().intern(MangledName);
+}
+
} // End namespace orc.
} // End namespace llvm.
Modified: llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp?rev=335661&r1=335660&r2=335661&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp Tue Jun 26 13:59:46 2018
@@ -15,18 +15,6 @@
namespace llvm {
namespace orc {
-MangleAndInterner::MangleAndInterner(ExecutionSession &ES, const DataLayout &DL)
- : ES(ES), DL(DL) {}
-
-SymbolStringPtr MangleAndInterner::operator()(StringRef Name) {
- std::string MangledName;
- {
- raw_string_ostream MangledNameStream(MangledName);
- Mangler::getNameWithPrefix(MangledNameStream, Name, DL);
- }
- return ES.getSymbolStringPool().intern(MangledName);
-}
-
IRLayer::IRLayer(ExecutionSession &ES) : ES(ES) {}
IRLayer::~IRLayer() {}
More information about the llvm-commits
mailing list