IRReader: don't mark MemoryBuffers const

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211883 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alp Toker 2014-06-27 09:19:14 +00:00
parent 22e371c74e
commit 9b0be7b61a
4 changed files with 5 additions and 7 deletions

View File

@ -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

View File

@ -41,8 +41,7 @@ Module *getLazyIRFileModule(const std::string &Filename, SMDiagnostic &Err,
/// 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

View File

@ -3406,10 +3406,9 @@ Module *llvm::getStreamedBitcodeModule(const std::string &name,
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();

View File

@ -62,7 +62,7 @@ Module *llvm::getLazyIRFileModule(const std::string &Filename, SMDiagnostic &Err
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);