Const-correctness in libLTO

Looks like I was sloppy when bridging to C.
Thanks D. Blaikie for noticing!

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263885
This commit is contained in:
Mehdi Amini 2016-03-19 21:28:18 +00:00
parent 220b2c4d1d
commit addc8d5410
2 changed files with 2 additions and 2 deletions

View File

@ -564,7 +564,7 @@ lto_codegen_set_should_embed_uselists(lto_code_gen_t cg,
* \since LTO_API_VERSION=18
*/
typedef struct {
void *Buffer;
const char *Buffer;
size_t Size;
} LTOObjectBuffer;

View File

@ -469,7 +469,7 @@ LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg,
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()};
}