Skip to content

Commit

Permalink
Const-correctness in libLTO
Browse files Browse the repository at this point in the history
Looks like I was sloppy when bridging to C.
Thanks D. Blaikie for noticing!

From: Mehdi Amini <[email protected]>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263885 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
joker-eph committed Mar 19, 2016
1 parent b6275da commit 14e4632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/llvm-c/lto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion tools/lto/lto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()};
}

Expand Down

0 comments on commit 14e4632

Please sign in to comment.