[llvm] r211864 - Propagate const-correctness into parseBitcodeFile()
Alp Toker
alp at nuanti.com
Thu Jun 26 21:48:32 PDT 2014
Author: alp
Date: Thu Jun 26 23:48:32 2014
New Revision: 211864
URL: http://llvm.org/viewvc/llvm-project?rev=211864&view=rev
Log:
Propagate const-correctness into parseBitcodeFile()
Modified:
llvm/trunk/include/llvm/Bitcode/ReaderWriter.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=211864&r1=211863&r2=211864&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/ReaderWriter.h (original)
+++ llvm/trunk/include/llvm/Bitcode/ReaderWriter.h Thu Jun 26 23:48:32 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(MemoryBuffer *Buffer,
+ ErrorOr<Module *> parseBitcodeFile(const MemoryBuffer *Buffer,
LLVMContext &Context);
/// WriteBitcodeToFile - Write the specified module to the specified
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=211864&r1=211863&r2=211864&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Thu Jun 26 23:48:32 2014
@@ -3406,9 +3406,10 @@ Module *llvm::getStreamedBitcodeModule(c
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();
Modified: llvm/trunk/lib/IRReader/IRReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IRReader/IRReader.cpp?rev=211864&r1=211863&r2=211864&view=diff
==============================================================================
--- llvm/trunk/lib/IRReader/IRReader.cpp (original)
+++ llvm/trunk/lib/IRReader/IRReader.cpp Thu Jun 26 23:48:32 2014
@@ -68,8 +68,7 @@ Module *llvm::ParseIR(const MemoryBuffer
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,
More information about the llvm-commits
mailing list