[PATCH] D45606: NFC: Move ObjectMemoryBuffer to support

Weiming Zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 19:08:00 PDT 2018


weimingz created this revision.
weimingz added reviewers: bkramer, dblaikie.
Herald added subscribers: eraman, mehdi_amini.

Since the class is used by both MCJIT and LTO, it makes more sense to move it to Support lib.
This is a follow up patch to r329929 and https://reviews.llvm.org/D45244


Repository:
  rL LLVM

https://reviews.llvm.org/D45606

Files:
  include/llvm/ExecutionEngine/ObjectMemoryBuffer.h
  include/llvm/ExecutionEngine/Orc/CompileUtils.h
  include/llvm/Support/ObjectMemoryBuffer.h
  lib/ExecutionEngine/MCJIT/MCJIT.h
  lib/LTO/LLVMBuild.txt
  lib/LTO/ThinLTOCodeGenerator.cpp
  lib/Support/MemoryBuffer.cpp


Index: lib/Support/MemoryBuffer.cpp
===================================================================
--- lib/Support/MemoryBuffer.cpp
+++ lib/Support/MemoryBuffer.cpp
@@ -18,6 +18,7 @@
 #include "llvm/Support/Errno.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/MathExtras.h"
+#include "llvm/Support/ObjectMemoryBuffer.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Program.h"
@@ -533,3 +534,4 @@
 }
 
 void MemoryBuffer::anchor() {}
+void ObjectMemoryBuffer::anchor() {}
Index: lib/LTO/ThinLTOCodeGenerator.cpp
===================================================================
--- lib/LTO/ThinLTOCodeGenerator.cpp
+++ lib/LTO/ThinLTOCodeGenerator.cpp
@@ -23,7 +23,6 @@
 #include "llvm/Bitcode/BitcodeReader.h"
 #include "llvm/Bitcode/BitcodeWriter.h"
 #include "llvm/Bitcode/BitcodeWriterPass.h"
-#include "llvm/ExecutionEngine/ObjectMemoryBuffer.h"
 #include "llvm/IR/DebugInfo.h"
 #include "llvm/IR/DiagnosticPrinter.h"
 #include "llvm/IR/LLVMContext.h"
@@ -37,6 +36,7 @@
 #include "llvm/Support/CachePruning.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/ObjectMemoryBuffer.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/SHA1.h"
 #include "llvm/Support/TargetRegistry.h"
Index: lib/LTO/LLVMBuild.txt
===================================================================
--- lib/LTO/LLVMBuild.txt
+++ lib/LTO/LLVMBuild.txt
@@ -37,4 +37,3 @@
  Support
  Target
  TransformUtils
- MCJIT
Index: lib/ExecutionEngine/MCJIT/MCJIT.h
===================================================================
--- lib/ExecutionEngine/MCJIT/MCJIT.h
+++ lib/ExecutionEngine/MCJIT/MCJIT.h
@@ -14,10 +14,10 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
 #include "llvm/ExecutionEngine/ObjectCache.h"
-#include "llvm/ExecutionEngine/ObjectMemoryBuffer.h"
 #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
 #include "llvm/ExecutionEngine/RuntimeDyld.h"
 #include "llvm/IR/Module.h"
+#include "llvm/Support/ObjectMemoryBuffer.h"
 
 namespace llvm {
 class MCJIT;
Index: include/llvm/Support/ObjectMemoryBuffer.h
===================================================================
--- include/llvm/Support/ObjectMemoryBuffer.h
+++ include/llvm/Support/ObjectMemoryBuffer.h
@@ -56,6 +56,7 @@
 private:
   SmallVector<char, 0> SV;
   std::string BufferName;
+  void anchor() override;
 };
 
 } // namespace llvm
Index: include/llvm/ExecutionEngine/Orc/CompileUtils.h
===================================================================
--- include/llvm/ExecutionEngine/Orc/CompileUtils.h
+++ include/llvm/ExecutionEngine/Orc/CompileUtils.h
@@ -16,13 +16,13 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ExecutionEngine/ObjectCache.h"
-#include "llvm/ExecutionEngine/ObjectMemoryBuffer.h"
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/ObjectMemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetMachine.h"
 #include <algorithm>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45606.142312.patch
Type: text/x-patch
Size: 3219 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180413/723dce9f/attachment.bin>


More information about the llvm-commits mailing list