Index: include/llvm/ExecutionEngine/Orc/CompileUtils.h =================================================================== --- include/llvm/ExecutionEngine/Orc/CompileUtils.h +++ include/llvm/ExecutionEngine/Orc/CompileUtils.h @@ -22,7 +22,7 @@ #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/ObjectMemoryBuffer.h" +#include "llvm/Support/SmallVectorMemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" #include Index: include/llvm/Support/SmallVectorMemoryBuffer.h =================================================================== --- include/llvm/Support/SmallVectorMemoryBuffer.h +++ include/llvm/Support/SmallVectorMemoryBuffer.h @@ -1,4 +1,5 @@ -//===- ObjectMemoryBuffer.h - SmallVector-backed MemoryBuffrer -*- C++ -*-===// +//===- SmallVectorMemoryBuffer.h - SmallVector-backed MemoryBuffrer -*- C++ +//-*-===// // // The LLVM Compiler Infrastructure // @@ -27,25 +28,26 @@ /// instances. This is useful for MCJIT and Orc, where object files are streamed /// into SmallVectors, then inspected using ObjectFile (which takes a /// MemoryBuffer). -class ObjectMemoryBuffer : public MemoryBuffer { +class SmallVectorMemoryBuffer : public MemoryBuffer { public: - - /// \brief Construct an ObjectMemoryBuffer from the given SmallVector r-value. + /// \brief Construct an SmallVectorMemoryBuffer from the given SmallVector + /// r-value. /// /// FIXME: It'd be nice for this to be a non-templated constructor taking a /// SmallVectorImpl here instead of a templated one taking a SmallVector, /// but SmallVector's move-construction/assignment currently only take /// SmallVectors. If/when that is fixed we can simplify this constructor and /// the following one. - ObjectMemoryBuffer(SmallVectorImpl &&SV) - : SV(std::move(SV)), BufferName("") { + SmallVectorMemoryBuffer(SmallVectorImpl &&SV) + : SV(std::move(SV)), BufferName("") { init(this->SV.begin(), this->SV.end(), false); } - /// \brief Construct a named ObjectMemoryBuffer from the given SmallVector + /// \brief Construct a named SmallVectorMemoryBuffer from the given + /// SmallVector /// r-value and StringRef. - ObjectMemoryBuffer(SmallVectorImpl &&SV, StringRef Name) - : SV(std::move(SV)), BufferName(Name) { + SmallVectorMemoryBuffer(SmallVectorImpl &&SV, StringRef Name) + : SV(std::move(SV)), BufferName(Name) { init(this->SV.begin(), this->SV.end(), false); } Index: lib/ExecutionEngine/MCJIT/MCJIT.h =================================================================== --- lib/ExecutionEngine/MCJIT/MCJIT.h +++ lib/ExecutionEngine/MCJIT/MCJIT.h @@ -17,7 +17,7 @@ #include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/ExecutionEngine/RuntimeDyld.h" #include "llvm/IR/Module.h" -#include "llvm/Support/ObjectMemoryBuffer.h" +#include "llvm/Support/SmallVectorMemoryBuffer.h" namespace llvm { class MCJIT; Index: lib/ExecutionEngine/MCJIT/MCJIT.cpp =================================================================== --- lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -164,7 +164,7 @@ // Flush the output buffer to get the generated code into memory std::unique_ptr CompiledObjBuffer( - new ObjectMemoryBuffer(std::move(ObjBufferSV))); + new SmallVectorMemoryBuffer(std::move(ObjBufferSV))); // If we have an object cache, tell it about the new object. // Note that we're using the compiled image, not the loaded image (as below). Index: lib/LTO/ThinLTOCodeGenerator.cpp =================================================================== --- lib/LTO/ThinLTOCodeGenerator.cpp +++ lib/LTO/ThinLTOCodeGenerator.cpp @@ -36,9 +36,9 @@ #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/SmallVectorMemoryBuffer.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/ThreadPool.h" #include "llvm/Support/Threading.h" @@ -274,7 +274,7 @@ // Run codegen now. resulting binary is in OutputBuffer. PM.run(TheModule); } - return make_unique(std::move(OutputBuffer)); + return make_unique(std::move(OutputBuffer)); } /// Manage caching for a single Module. @@ -475,7 +475,7 @@ auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); WriteBitcodeToFile(TheModule, OS, true, &Index); } - return make_unique(std::move(OutputBuffer)); + return make_unique(std::move(OutputBuffer)); } return codegenModule(TheModule, TM); Index: lib/Support/MemoryBuffer.cpp =================================================================== --- lib/Support/MemoryBuffer.cpp +++ lib/Support/MemoryBuffer.cpp @@ -18,10 +18,10 @@ #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" +#include "llvm/Support/SmallVectorMemoryBuffer.h" #include #include #include @@ -534,4 +534,4 @@ } void MemoryBuffer::anchor() {} -void ObjectMemoryBuffer::anchor() {} +void SmallVectorMemoryBuffer::anchor() {}