llvm.org GIT mirror llvm / 9fc1a6f
Propagate const-correctness into parseBitcodeFile() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211864 91177308-0d34-0410-b5e6-96231b3b80d8 Alp Toker 6 years ago
3 changed file(s) with 5 addition(s) and 5 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(MemoryBuffer *Buffer,
54 ErrorOr parseBitcodeFile(const MemoryBuffer *Buffer,
5555 LLVMContext &Context);
5656
5757 /// WriteBitcodeToFile - Write the specified module to the specified
34053405 return M;
34063406 }
34073407
3408 ErrorOr llvm::parseBitcodeFile(MemoryBuffer *Buffer,
3408 ErrorOr llvm::parseBitcodeFile(const MemoryBuffer *Buffer,
34093409 LLVMContext &Context) {
3410 ErrorOr ModuleOrErr = getLazyBitcodeModule(Buffer, Context);
3410 ErrorOr ModuleOrErr =
3411 getLazyBitcodeModule(const_cast(Buffer), Context);
34113412 if (!ModuleOrErr)
34123413 return ModuleOrErr;
34133414 Module *M = ModuleOrErr.get();
6767 TimePassesIsEnabled);
6868 if (isBitcode((const unsigned char *)Buffer->getBufferStart(),
6969 (const unsigned char *)Buffer->getBufferEnd())) {
70 ErrorOr ModuleOrErr =
71 parseBitcodeFile(const_cast(Buffer), Context);
70 ErrorOr ModuleOrErr = parseBitcodeFile(Buffer, Context);
7271 Module *M = nullptr;
7372 if (std::error_code EC = ModuleOrErr.getError())
7473 Err = SMDiagnostic(Buffer->getBufferIdentifier(), SourceMgr::DK_Error,