llvm.org GIT mirror llvm / 9b0be7b
IRReader: don't mark MemoryBuffers const git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211883 91177308-0d34-0410-b5e6-96231b3b80d8 Alp Toker 6 years ago
4 changed file(s) with 5 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
5151
5252 /// Read the specified bitcode file, returning the module.
5353 /// This method *never* takes ownership of Buffer.
54 ErrorOr parseBitcodeFile(const MemoryBuffer *Buffer,
54 ErrorOr parseBitcodeFile(MemoryBuffer *Buffer,
5555 LLVMContext &Context);
5656
5757 /// WriteBitcodeToFile - Write the specified module to the specified
4040 /// If the given MemoryBuffer holds a bitcode image, return a Module
4141 /// for it. Otherwise, attempt to parse it as LLVM Assembly and return
4242 /// a Module for it. This function *never* takes ownership of Buffer.
43 Module *ParseIR(const MemoryBuffer *Buffer, SMDiagnostic &Err,
44 LLVMContext &Context);
43 Module *ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err, LLVMContext &Context);
4544
4645 /// If the given file holds a bitcode image, return a Module for it.
4746 /// Otherwise, attempt to parse it as LLVM Assembly and return a Module
34053405 return M;
34063406 }
34073407
3408 ErrorOr llvm::parseBitcodeFile(const MemoryBuffer *Buffer,
3408 ErrorOr llvm::parseBitcodeFile(MemoryBuffer *Buffer,
34093409 LLVMContext &Context) {
3410 ErrorOr ModuleOrErr =
3411 getLazyBitcodeModule(const_cast(Buffer), Context);
3410 ErrorOr ModuleOrErr = getLazyBitcodeModule(Buffer, Context);
34123411 if (!ModuleOrErr)
34133412 return ModuleOrErr;
34143413 Module *M = ModuleOrErr.get();
6161 return getLazyIRModule(File.release(), Err, Context);
6262 }
6363
64 Module *llvm::ParseIR(const MemoryBuffer *Buffer, SMDiagnostic &Err,
64 Module *llvm::ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err,
6565 LLVMContext &Context) {
6666 NamedRegionTimer T(TimeIRParsingName, TimeIRParsingGroupName,
6767 TimePassesIsEnabled);