diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index c88d9651d68..f7df648d27e 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -2286,7 +2286,7 @@ void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes); /// LoadIntFromMemory - Loads the integer stored in the LoadBytes bytes starting /// from Src into IntVal, which is assumed to be wide enough and to hold zero. -void LoadIntFromMemory(APInt &IntVal, uint8_t *Src, unsigned LoadBytes); +void LoadIntFromMemory(APInt &IntVal, const uint8_t *Src, unsigned LoadBytes); } // namespace llvm diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 4a591efb141..9a6f93feaa2 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -3086,7 +3086,8 @@ void llvm::StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, /// LoadIntFromMemory - Loads the integer stored in the LoadBytes bytes starting /// from Src into IntVal, which is assumed to be wide enough and to hold zero. -void llvm::LoadIntFromMemory(APInt &IntVal, uint8_t *Src, unsigned LoadBytes) { +void llvm::LoadIntFromMemory(APInt &IntVal, const uint8_t *Src, + unsigned LoadBytes) { assert((IntVal.getBitWidth()+7)/8 >= LoadBytes && "Integer too small!"); uint8_t *Dst = reinterpret_cast( const_cast(IntVal.getRawData()));