[llvm] r216488 - Pass a MemoryBufferRef when we can avoid taking ownership.
Rafael Espindola
rafael.espindola at gmail.com
Tue Aug 26 14:49:01 PDT 2014
Author: rafael
Date: Tue Aug 26 16:49:01 2014
New Revision: 216488
URL: http://llvm.org/viewvc/llvm-project?rev=216488&view=rev
Log:
Pass a MemoryBufferRef when we can avoid taking ownership.
The attached patch simplifies a few interfaces that don't need to take
ownership of a buffer.
For example, both parseAssembly and parseBitcodeFile will parse the
entire buffer before returning. There is no need to take ownership.
Using a MemoryBufferRef makes it obvious in the type signature that
there is no ownership transfer.
Modified:
llvm/trunk/include/llvm/AsmParser/Parser.h
llvm/trunk/include/llvm/Bitcode/ReaderWriter.h
llvm/trunk/include/llvm/IR/GVMaterializer.h
llvm/trunk/include/llvm/IR/Module.h
llvm/trunk/include/llvm/IRReader/IRReader.h
llvm/trunk/include/llvm/Support/MemoryBuffer.h
llvm/trunk/lib/AsmParser/Parser.cpp
llvm/trunk/lib/Bitcode/Reader/BitReader.cpp
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
llvm/trunk/lib/IR/Module.cpp
llvm/trunk/lib/IRReader/IRReader.cpp
llvm/trunk/lib/LTO/LTOModule.cpp
llvm/trunk/lib/Object/IRObjectFile.cpp
llvm/trunk/lib/Support/MemoryBuffer.cpp
llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp
Modified: llvm/trunk/include/llvm/AsmParser/Parser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/AsmParser/Parser.h?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/include/llvm/AsmParser/Parser.h (original)
+++ llvm/trunk/include/llvm/AsmParser/Parser.h Tue Aug 26 16:49:01 2014
@@ -14,13 +14,11 @@
#ifndef LLVM_ASMPARSER_PARSER_H
#define LLVM_ASMPARSER_PARSER_H
-#include "llvm/ADT/StringRef.h"
-#include <memory>
+#include "llvm/Support/MemoryBuffer.h"
namespace llvm {
class Module;
-class MemoryBuffer;
class SMDiagnostic;
class LLVMContext;
@@ -55,8 +53,8 @@ std::unique_ptr<Module> parseAssemblyStr
/// @param F The MemoryBuffer containing assembly
/// @param Err Error result info.
/// @param Context Context in which to allocate globals info.
-std::unique_ptr<Module> parseAssembly(std::unique_ptr<MemoryBuffer> F,
- SMDiagnostic &Err, LLVMContext &Context);
+std::unique_ptr<Module> parseAssembly(MemoryBufferRef F, SMDiagnostic &Err,
+ LLVMContext &Context);
/// This function is the low-level interface to the LLVM Assembly Parser.
/// This is kept as an independent function instead of being inlined into
@@ -67,8 +65,7 @@ std::unique_ptr<Module> parseAssembly(st
/// @param M The module to add data to.
/// @param Err Error result info.
/// @return true on error.
-bool parseAssemblyInto(std::unique_ptr<MemoryBuffer> F, Module &M,
- SMDiagnostic &Err);
+bool parseAssemblyInto(MemoryBufferRef F, Module &M, SMDiagnostic &Err);
} // End llvm namespace
Modified: llvm/trunk/include/llvm/Bitcode/ReaderWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/ReaderWriter.h?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/ReaderWriter.h (original)
+++ llvm/trunk/include/llvm/Bitcode/ReaderWriter.h Tue Aug 26 16:49:01 2014
@@ -15,11 +15,11 @@
#define LLVM_BITCODE_READERWRITER_H
#include "llvm/Support/ErrorOr.h"
+#include "llvm/Support/MemoryBuffer.h"
#include <string>
namespace llvm {
class BitstreamWriter;
- class MemoryBuffer;
class DataStreamer;
class LLVMContext;
class Module;
@@ -42,14 +42,13 @@ namespace llvm {
std::string *ErrMsg = nullptr);
/// Read the header of the specified bitcode buffer and extract just the
- /// triple information. If successful, this returns a string and *does not*
- /// take ownership of 'buffer'. On error, this returns "".
- std::string getBitcodeTargetTriple(MemoryBuffer *Buffer,
+ /// triple information. If successful, this returns a string. On error, this
+ /// returns "".
+ std::string getBitcodeTargetTriple(MemoryBufferRef Buffer,
LLVMContext &Context);
/// Read the specified bitcode file, returning the module.
- /// This method *never* takes ownership of Buffer.
- ErrorOr<Module *> parseBitcodeFile(MemoryBuffer *Buffer,
+ ErrorOr<Module *> parseBitcodeFile(MemoryBufferRef Buffer,
LLVMContext &Context);
/// WriteBitcodeToFile - Write the specified module to the specified
Modified: llvm/trunk/include/llvm/IR/GVMaterializer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/GVMaterializer.h?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/GVMaterializer.h (original)
+++ llvm/trunk/include/llvm/IR/GVMaterializer.h Tue Aug 26 16:49:01 2014
@@ -54,8 +54,6 @@ public:
/// Make sure the entire Module has been completely read.
///
virtual std::error_code MaterializeModule(Module *M) = 0;
-
- virtual void releaseBuffer() = 0;
};
} // End llvm namespace
Modified: llvm/trunk/include/llvm/IR/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Module.h?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Module.h (original)
+++ llvm/trunk/include/llvm/IR/Module.h Tue Aug 26 16:49:01 2014
@@ -483,7 +483,7 @@ public:
/// Make sure all GlobalValues in this Module are fully read and clear the
/// Materializer. If the module is corrupt, this DOES NOT clear the old
/// Materializer.
- std::error_code materializeAllPermanently(bool ReleaseBuffer = false);
+ std::error_code materializeAllPermanently();
/// @}
/// @name Direct access to the globals list, functions list, and symbol table
Modified: llvm/trunk/include/llvm/IRReader/IRReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IRReader/IRReader.h?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IRReader/IRReader.h (original)
+++ llvm/trunk/include/llvm/IRReader/IRReader.h Tue Aug 26 16:49:01 2014
@@ -15,14 +15,12 @@
#ifndef LLVM_IRREADER_IRREADER_H
#define LLVM_IRREADER_IRREADER_H
-#include "llvm/ADT/StringRef.h"
-#include <memory>
+#include "llvm/Support/MemoryBuffer.h"
#include <string>
namespace llvm {
class Module;
-class MemoryBuffer;
class SMDiagnostic;
class LLVMContext;
@@ -36,8 +34,8 @@ std::unique_ptr<Module> getLazyIRFileMod
/// If the given MemoryBuffer holds a bitcode image, return a Module
/// for it. Otherwise, attempt to parse it as LLVM Assembly and return
-/// a Module for it. This function *never* takes ownership of Buffer.
-std::unique_ptr<Module> parseIR(MemoryBuffer *Buffer, SMDiagnostic &Err,
+/// a Module for it.
+std::unique_ptr<Module> parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err,
LLVMContext &Context);
/// If the given file holds a bitcode image, return a Module for it.
Modified: llvm/trunk/include/llvm/Support/MemoryBuffer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MemoryBuffer.h?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MemoryBuffer.h (original)
+++ llvm/trunk/include/llvm/Support/MemoryBuffer.h Tue Aug 26 16:49:01 2014
@@ -102,6 +102,9 @@ public:
StringRef BufferName = "",
bool RequiresNullTerminator = true);
+ static std::unique_ptr<MemoryBuffer>
+ getMemBuffer(MemoryBufferRef Ref, bool RequiresNullTerminator = true);
+
/// Open the specified memory range as a MemoryBuffer, copying the contents
/// and taking ownership of it. InputData does not have to be null terminated.
static MemoryBuffer *getMemBufferCopy(StringRef InputData,
Modified: llvm/trunk/lib/AsmParser/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/Parser.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/Parser.cpp (original)
+++ llvm/trunk/lib/AsmParser/Parser.cpp Tue Aug 26 16:49:01 2014
@@ -21,22 +21,21 @@
#include <system_error>
using namespace llvm;
-bool llvm::parseAssemblyInto(std::unique_ptr<MemoryBuffer> F, Module &M,
- SMDiagnostic &Err) {
+bool llvm::parseAssemblyInto(MemoryBufferRef F, Module &M, SMDiagnostic &Err) {
SourceMgr SM;
- StringRef Buf = F->getBuffer();
- SM.AddNewSourceBuffer(std::move(F), SMLoc());
+ std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(F, false);
+ SM.AddNewSourceBuffer(std::move(Buf), SMLoc());
- return LLParser(Buf, SM, Err, &M).Run();
+ return LLParser(F.getBuffer(), SM, Err, &M).Run();
}
-std::unique_ptr<Module> llvm::parseAssembly(std::unique_ptr<MemoryBuffer> F,
+std::unique_ptr<Module> llvm::parseAssembly(MemoryBufferRef F,
SMDiagnostic &Err,
LLVMContext &Context) {
std::unique_ptr<Module> M =
- make_unique<Module>(F->getBufferIdentifier(), Context);
+ make_unique<Module>(F.getBufferIdentifier(), Context);
- if (parseAssemblyInto(std::move(F), *M, Err))
+ if (parseAssemblyInto(F, *M, Err))
return nullptr;
return std::move(M);
@@ -53,14 +52,12 @@ std::unique_ptr<Module> llvm::parseAssem
return nullptr;
}
- return parseAssembly(std::move(FileOrErr.get()), Err, Context);
+ return parseAssembly(FileOrErr.get()->getMemBufferRef(), Err, Context);
}
std::unique_ptr<Module> llvm::parseAssemblyString(StringRef AsmString,
SMDiagnostic &Err,
LLVMContext &Context) {
- std::unique_ptr<MemoryBuffer> F(
- MemoryBuffer::getMemBuffer(AsmString, "<string>"));
-
- return parseAssembly(std::move(F), Err, Context);
+ MemoryBufferRef F(AsmString, "<string>");
+ return parseAssembly(F, Err, Context);
}
Modified: llvm/trunk/lib/Bitcode/Reader/BitReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitReader.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitReader.cpp Tue Aug 26 16:49:01 2014
@@ -31,7 +31,7 @@ LLVMBool LLVMParseBitcodeInContext(LLVMC
LLVMModuleRef *OutModule,
char **OutMessage) {
ErrorOr<Module *> ModuleOrErr =
- parseBitcodeFile(unwrap(MemBuf), *unwrap(ContextRef));
+ parseBitcodeFile(unwrap(MemBuf)->getMemBufferRef(), *unwrap(ContextRef));
if (std::error_code EC = ModuleOrErr.getError()) {
if (OutMessage)
*OutMessage = strdup(EC.message().c_str());
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Aug 26 16:49:01 2014
@@ -3564,15 +3564,17 @@ Module *llvm::getStreamedBitcodeModule(c
return M;
}
-ErrorOr<Module *> llvm::parseBitcodeFile(MemoryBuffer *Buffer,
+ErrorOr<Module *> llvm::parseBitcodeFile(MemoryBufferRef Buffer,
LLVMContext &Context) {
+ std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(Buffer, false);
ErrorOr<Module *> ModuleOrErr =
- getLazyBitcodeModuleImpl(Buffer, Context, true);
+ getLazyBitcodeModuleImpl(Buf.get(), Context, true);
if (!ModuleOrErr)
return ModuleOrErr;
+ Buf.release(); // The BitcodeReader owns it now.
Module *M = ModuleOrErr.get();
// Read in the entire module, and destroy the BitcodeReader.
- if (std::error_code EC = M->materializeAllPermanently(true)) {
+ if (std::error_code EC = M->materializeAllPermanently()) {
delete M;
return EC;
}
@@ -3583,12 +3585,11 @@ ErrorOr<Module *> llvm::parseBitcodeFile
return M;
}
-std::string llvm::getBitcodeTargetTriple(MemoryBuffer *Buffer,
+std::string llvm::getBitcodeTargetTriple(MemoryBufferRef Buffer,
LLVMContext &Context) {
- BitcodeReader *R = new BitcodeReader(Buffer, Context);
+ std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(Buffer, false);
+ auto R = llvm::make_unique<BitcodeReader>(Buf.get(), Context);
ErrorOr<std::string> Triple = R->parseTriple();
- R->releaseBuffer();
- delete R;
if (Triple.getError())
return "";
return Triple.get();
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h Tue Aug 26 16:49:01 2014
@@ -221,7 +221,7 @@ public:
void FreeState();
- void releaseBuffer() override;
+ void releaseBuffer();
bool isMaterializable(const GlobalValue *GV) const override;
bool isDematerializable(const GlobalValue *GV) const override;
Modified: llvm/trunk/lib/IR/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Module.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Module.cpp (original)
+++ llvm/trunk/lib/IR/Module.cpp Tue Aug 26 16:49:01 2014
@@ -413,13 +413,10 @@ std::error_code Module::materializeAll()
return Materializer->MaterializeModule(this);
}
-std::error_code Module::materializeAllPermanently(bool ReleaseBuffer) {
+std::error_code Module::materializeAllPermanently() {
if (std::error_code EC = materializeAll())
return EC;
- if (ReleaseBuffer)
- Materializer->releaseBuffer();
-
Materializer.reset();
return std::error_code();
}
Modified: llvm/trunk/lib/IRReader/IRReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IRReader/IRReader.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/IRReader/IRReader.cpp (original)
+++ llvm/trunk/lib/IRReader/IRReader.cpp Tue Aug 26 16:49:01 2014
@@ -46,7 +46,7 @@ getLazyIRModule(std::unique_ptr<MemoryBu
return std::unique_ptr<Module>(ModuleOrErr.get());
}
- return parseAssembly(std::move(Buffer), Err, Context);
+ return parseAssembly(Buffer->getMemBufferRef(), Err, Context);
}
std::unique_ptr<Module> llvm::getLazyIRFileModule(StringRef Filename,
@@ -63,24 +63,22 @@ std::unique_ptr<Module> llvm::getLazyIRF
return getLazyIRModule(std::move(FileOrErr.get()), Err, Context);
}
-std::unique_ptr<Module> llvm::parseIR(MemoryBuffer *Buffer, SMDiagnostic &Err,
+std::unique_ptr<Module> llvm::parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err,
LLVMContext &Context) {
NamedRegionTimer T(TimeIRParsingName, TimeIRParsingGroupName,
TimePassesIsEnabled);
- if (isBitcode((const unsigned char *)Buffer->getBufferStart(),
- (const unsigned char *)Buffer->getBufferEnd())) {
+ if (isBitcode((const unsigned char *)Buffer.getBufferStart(),
+ (const unsigned char *)Buffer.getBufferEnd())) {
ErrorOr<Module *> ModuleOrErr = parseBitcodeFile(Buffer, Context);
if (std::error_code EC = ModuleOrErr.getError()) {
- Err = SMDiagnostic(Buffer->getBufferIdentifier(), SourceMgr::DK_Error,
+ Err = SMDiagnostic(Buffer.getBufferIdentifier(), SourceMgr::DK_Error,
EC.message());
return nullptr;
}
return std::unique_ptr<Module>(ModuleOrErr.get());
}
- return parseAssembly(std::unique_ptr<MemoryBuffer>(MemoryBuffer::getMemBuffer(
- Buffer->getBuffer(), Buffer->getBufferIdentifier())),
- Err, Context);
+ return parseAssembly(Buffer, Err, Context);
}
std::unique_ptr<Module> llvm::parseIRFile(StringRef Filename, SMDiagnostic &Err,
@@ -93,7 +91,7 @@ std::unique_ptr<Module> llvm::parseIRFil
return nullptr;
}
- return parseIR(FileOrErr.get().get(), Err, Context);
+ return parseIR(FileOrErr.get()->getMemBufferRef(), Err, Context);
}
//===----------------------------------------------------------------------===//
@@ -106,7 +104,8 @@ LLVMBool LLVMParseIRInContext(LLVMContex
SMDiagnostic Diag;
std::unique_ptr<MemoryBuffer> MB(unwrap(MemBuf));
- *OutM = wrap(parseIR(MB.get(), Diag, *unwrap(ContextRef)).release());
+ *OutM =
+ wrap(parseIR(MB->getMemBufferRef(), Diag, *unwrap(ContextRef)).release());
if(!*OutM) {
if (OutMessage) {
Modified: llvm/trunk/lib/LTO/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOModule.cpp (original)
+++ llvm/trunk/lib/LTO/LTOModule.cpp Tue Aug 26 16:49:01 2014
@@ -65,7 +65,8 @@ bool LTOModule::isBitcodeFile(const char
bool LTOModule::isBitcodeForTarget(MemoryBuffer *buffer,
StringRef triplePrefix) {
- std::string Triple = getBitcodeTargetTriple(buffer, getGlobalContext());
+ std::string Triple =
+ getBitcodeTargetTriple(buffer->getMemBufferRef(), getGlobalContext());
return StringRef(Triple).startswith(triplePrefix);
}
@@ -112,14 +113,7 @@ LTOModule *LTOModule::createFromBuffer(c
LTOModule *LTOModule::makeLTOModule(MemoryBufferRef Buffer,
TargetOptions options,
std::string &errMsg) {
- StringRef Data = Buffer.getBuffer();
- StringRef FileName = Buffer.getBufferIdentifier();
- std::unique_ptr<MemoryBuffer> MemBuf(
- makeBuffer(Data.begin(), Data.size(), FileName));
- if (!MemBuf)
- return nullptr;
-
- ErrorOr<Module *> MOrErr = parseBitcodeFile(MemBuf.get(), getGlobalContext());
+ ErrorOr<Module *> MOrErr = parseBitcodeFile(Buffer, getGlobalContext());
if (std::error_code EC = MOrErr.getError()) {
errMsg = EC.message();
return nullptr;
Modified: llvm/trunk/lib/Object/IRObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/IRObjectFile.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/Object/IRObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/IRObjectFile.cpp Tue Aug 26 16:49:01 2014
@@ -268,10 +268,7 @@ ErrorOr<IRObjectFile *>
llvm::object::IRObjectFile::createIRObjectFile(MemoryBufferRef Object,
LLVMContext &Context) {
- StringRef Data = Object.getBuffer();
- StringRef FileName = Object.getBufferIdentifier();
- std::unique_ptr<MemoryBuffer> Buff(
- MemoryBuffer::getMemBuffer(Data, FileName, false));
+ std::unique_ptr<MemoryBuffer> Buff(MemoryBuffer::getMemBuffer(Object, false));
ErrorOr<Module *> MOrErr = getLazyBitcodeModule(Buff.get(), Context);
if (std::error_code EC = MOrErr.getError())
Modified: llvm/trunk/lib/Support/MemoryBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MemoryBuffer.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/lib/Support/MemoryBuffer.cpp (original)
+++ llvm/trunk/lib/Support/MemoryBuffer.cpp Tue Aug 26 16:49:01 2014
@@ -103,6 +103,12 @@ MemoryBuffer *MemoryBuffer::getMemBuffer
MemoryBufferMem(InputData, RequiresNullTerminator);
}
+std::unique_ptr<MemoryBuffer>
+MemoryBuffer::getMemBuffer(MemoryBufferRef Ref, bool RequiresNullTerminator) {
+ return std::unique_ptr<MemoryBuffer>(getMemBuffer(
+ Ref.getBuffer(), Ref.getBufferIdentifier(), RequiresNullTerminator));
+}
+
/// getMemBufferCopy - Open the specified memory range as a MemoryBuffer,
/// copying the contents and taking ownership of it. This has no requirements
/// on EndPtr[0].
Modified: llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp?rev=216488&r1=216487&r2=216488&view=diff
==============================================================================
--- llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp (original)
+++ llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp Tue Aug 26 16:49:01 2014
@@ -157,7 +157,8 @@ std::unique_ptr<Module> TempFile::readBi
}
MemoryBuffer *Buffer = BufferOr.get().get();
- ErrorOr<Module *> ModuleOr = parseBitcodeFile(Buffer, Context);
+ ErrorOr<Module *> ModuleOr =
+ parseBitcodeFile(Buffer->getMemBufferRef(), Context);
if (!ModuleOr) {
DEBUG(dbgs() << "error: " << ModuleOr.getError().message() << "\n");
return nullptr;
More information about the llvm-commits
mailing list