diff options
author | Pavel Labath <pavel@labath.sk> | 2020-07-13 17:15:25 +0200 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2020-07-13 17:32:54 +0200 |
commit | a2552f76ac6ff705434adb1d277a578445721b78 (patch) | |
tree | 63dbe9e1ea436ad34f38f33ede6d1ffbb4968a4f /llvm/lib/Support/APInt.cpp | |
parent | 4d3e8dc215d1ca99354f3c33cce87795d2b5098a (diff) | |
download | llvm-a2552f76ac6ff705434adb1d277a578445721b78.zip llvm-a2552f76ac6ff705434adb1d277a578445721b78.tar.gz llvm-a2552f76ac6ff705434adb1d277a578445721b78.tar.bz2 |
[ADT] Make Load(AP)IntFromMemory pointer argument const
The function does not modify this memory.
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 4a591ef..9a6f93f 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/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<uint8_t *>( const_cast<uint64_t *>(IntVal.getRawData())); |