[llvm] r211883 - IRReader: don't mark MemoryBuffers const
Alp Toker
alp at nuanti.com
Fri Jun 27 02:19:15 PDT 2014
Author: alp
Date: Fri Jun 27 04:19:14 2014
New Revision: 211883
URL: http://llvm.org/viewvc/llvm-project?rev=211883&view=rev
Log:
IRReader: don't mark MemoryBuffers const
Modified:
llvm/trunk/include/llvm/Bitcode/ReaderWriter.h
llvm/trunk/include/llvm/IRReader/IRReader.h
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/IRReader/IRReader.cpp
Modified: llvm/trunk/include/llvm/Bitcode/ReaderWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/ReaderWriter.h?rev=211883&r1=211882&r2=211883&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/ReaderWriter.h (original)
+++ llvm/trunk/include/llvm/Bitcode/ReaderWriter.h Fri Jun 27 04:19:14 2014
@@ -52,7 +52,7 @@ namespace llvm {
/// Read the specified bitcode file, returning the module.
/// This method *never* takes ownership of Buffer.
- ErrorOr<Module *> parseBitcodeFile(const MemoryBuffer *Buffer,
+ ErrorOr<Module *> parseBitcodeFile(MemoryBuffer *Buffer,
LLVMContext &Context);
/// WriteBitcodeToFile - Write the specified module to the specified
Modified: llvm/trunk/include/llvm/IRReader/IRReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IRReader/IRReader.h?rev=211883&r1=211882&r2=211883&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IRReader/IRReader.h (original)
+++ llvm/trunk/include/llvm/IRReader/IRReader.h Fri Jun 27 04:19:14 2014
@@ -41,8 +41,7 @@ Module *getLazyIRFileModule(const std::s
/// 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.
-Module *ParseIR(const MemoryBuffer *Buffer, SMDiagnostic &Err,
- LLVMContext &Context);
+Module *ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err, LLVMContext &Context);
/// If the given file holds a bitcode image, return a Module for it.
/// Otherwise, attempt to parse it as LLVM Assembly and return a Module
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=211883&r1=211882&r2=211883&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Jun 27 04:19:14 2014
@@ -3406,10 +3406,9 @@ Module *llvm::getStreamedBitcodeModule(c
return M;
}
-ErrorOr<Module *> llvm::parseBitcodeFile(const MemoryBuffer *Buffer,
+ErrorOr<Module *> llvm::parseBitcodeFile(MemoryBuffer *Buffer,
LLVMContext &Context) {
- ErrorOr<Module *> ModuleOrErr =
- getLazyBitcodeModule(const_cast<MemoryBuffer *>(Buffer), Context);
+ ErrorOr<Module *> ModuleOrErr = getLazyBitcodeModule(Buffer, Context);
if (!ModuleOrErr)
return ModuleOrErr;
Module *M = ModuleOrErr.get();
Modified: llvm/trunk/lib/IRReader/IRReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IRReader/IRReader.cpp?rev=211883&r1=211882&r2=211883&view=diff
==============================================================================
--- llvm/trunk/lib/IRReader/IRReader.cpp (original)
+++ llvm/trunk/lib/IRReader/IRReader.cpp Fri Jun 27 04:19:14 2014
@@ -62,7 +62,7 @@ Module *llvm::getLazyIRFileModule(const
return getLazyIRModule(File.release(), Err, Context);
}
-Module *llvm::ParseIR(const MemoryBuffer *Buffer, SMDiagnostic &Err,
+Module *llvm::ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err,
LLVMContext &Context) {
NamedRegionTimer T(TimeIRParsingName, TimeIRParsingGroupName,
TimePassesIsEnabled);
More information about the llvm-commits
mailing list