[llvm] r263885 - Const-correctness in libLTO
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 19 14:28:19 PDT 2016
Author: mehdi_amini
Date: Sat Mar 19 16:28:18 2016
New Revision: 263885
URL: http://llvm.org/viewvc/llvm-project?rev=263885&view=rev
Log:
Const-correctness in libLTO
Looks like I was sloppy when bridging to C.
Thanks D. Blaikie for noticing!
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/include/llvm-c/lto.h
llvm/trunk/tools/lto/lto.cpp
Modified: llvm/trunk/include/llvm-c/lto.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/lto.h?rev=263885&r1=263884&r2=263885&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/lto.h (original)
+++ llvm/trunk/include/llvm-c/lto.h Sat Mar 19 16:28:18 2016
@@ -564,7 +564,7 @@ lto_codegen_set_should_embed_uselists(lt
* \since LTO_API_VERSION=18
*/
typedef struct {
- void *Buffer;
+ const char *Buffer;
size_t Size;
} LTOObjectBuffer;
Modified: llvm/trunk/tools/lto/lto.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=263885&r1=263884&r2=263885&view=diff
==============================================================================
--- llvm/trunk/tools/lto/lto.cpp (original)
+++ llvm/trunk/tools/lto/lto.cpp Sat Mar 19 16:28:18 2016
@@ -469,7 +469,7 @@ LTOObjectBuffer thinlto_module_get_objec
unsigned int index) {
assert(index < unwrap(cg)->getProducedBinaries().size() && "Index overflow");
auto &MemBuffer = unwrap(cg)->getProducedBinaries()[index];
- return LTOObjectBuffer{const_cast<char *>(MemBuffer->getBufferStart()),
+ return LTOObjectBuffer{MemBuffer->getBufferStart(),
MemBuffer->getBufferSize()};
}
More information about the llvm-commits
mailing list