mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
Propagate const-correctness into parseBitcodeFile()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211864 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
260f9375bd
commit
9fc1a6ffb7
@ -52,7 +52,7 @@ namespace llvm {
|
||||
|
||||
/// Read the specified bitcode file, returning the module.
|
||||
/// This method *never* takes ownership of Buffer.
|
||||
ErrorOr<Module *> parseBitcodeFile(MemoryBuffer *Buffer,
|
||||
ErrorOr<Module *> parseBitcodeFile(const MemoryBuffer *Buffer,
|
||||
LLVMContext &Context);
|
||||
|
||||
/// WriteBitcodeToFile - Write the specified module to the specified
|
||||
|
@ -3406,9 +3406,10 @@ Module *llvm::getStreamedBitcodeModule(const std::string &name,
|
||||
return M;
|
||||
}
|
||||
|
||||
ErrorOr<Module *> llvm::parseBitcodeFile(MemoryBuffer *Buffer,
|
||||
ErrorOr<Module *> llvm::parseBitcodeFile(const MemoryBuffer *Buffer,
|
||||
LLVMContext &Context) {
|
||||
ErrorOr<Module *> ModuleOrErr = getLazyBitcodeModule(Buffer, Context);
|
||||
ErrorOr<Module *> ModuleOrErr =
|
||||
getLazyBitcodeModule(const_cast<MemoryBuffer *>(Buffer), Context);
|
||||
if (!ModuleOrErr)
|
||||
return ModuleOrErr;
|
||||
Module *M = ModuleOrErr.get();
|
||||
|
@ -68,8 +68,7 @@ Module *llvm::ParseIR(const MemoryBuffer *Buffer, SMDiagnostic &Err,
|
||||
TimePassesIsEnabled);
|
||||
if (isBitcode((const unsigned char *)Buffer->getBufferStart(),
|
||||
(const unsigned char *)Buffer->getBufferEnd())) {
|
||||
ErrorOr<Module *> ModuleOrErr =
|
||||
parseBitcodeFile(const_cast<MemoryBuffer *>(Buffer), Context);
|
||||
ErrorOr<Module *> ModuleOrErr = parseBitcodeFile(Buffer, Context);
|
||||
Module *M = nullptr;
|
||||
if (std::error_code EC = ModuleOrErr.getError())
|
||||
Err = SMDiagnostic(Buffer->getBufferIdentifier(), SourceMgr::DK_Error,
|
||||
|
Loading…
Reference in New Issue
Block a user