[llvm] d1e5dc2 - [NFC] Add const qualifier for parameters of functions in Instructions.h
Shengchen Kan via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 3 02:05:12 PDT 2024
Author: Shengchen Kan
Date: 2024-08-03T17:04:27+08:00
New Revision: d1e5dc254de7c543a971ebd58412e9a727f06536
URL: https://github.com/llvm/llvm-project/commit/d1e5dc254de7c543a971ebd58412e9a727f06536
DIFF: https://github.com/llvm/llvm-project/commit/d1e5dc254de7c543a971ebd58412e9a727f06536.diff
LOG: [NFC] Add const qualifier for parameters of functions in Instructions.h
This is to extract the NFC change in #96878 into a separate PR.
Added:
Modified:
llvm/include/llvm/IR/Instructions.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h
index c07fee58e4bdb..968737a843e29 100644
--- a/llvm/include/llvm/IR/Instructions.h
+++ b/llvm/include/llvm/IR/Instructions.h
@@ -4897,7 +4897,7 @@ inline Value *getPointerOperand(Value *V) {
}
/// A helper function that returns the alignment of load or store instruction.
-inline Align getLoadStoreAlignment(Value *I) {
+inline Align getLoadStoreAlignment(const Value *I) {
assert((isa<LoadInst>(I) || isa<StoreInst>(I)) &&
"Expected Load or Store instruction");
if (auto *LI = dyn_cast<LoadInst>(I))
@@ -4907,7 +4907,7 @@ inline Align getLoadStoreAlignment(Value *I) {
/// A helper function that returns the address space of the pointer operand of
/// load or store instruction.
-inline unsigned getLoadStoreAddressSpace(Value *I) {
+inline unsigned getLoadStoreAddressSpace(const Value *I) {
assert((isa<LoadInst>(I) || isa<StoreInst>(I)) &&
"Expected Load or Store instruction");
if (auto *LI = dyn_cast<LoadInst>(I))
@@ -4916,7 +4916,7 @@ inline unsigned getLoadStoreAddressSpace(Value *I) {
}
/// A helper function that returns the type of a load or store instruction.
-inline Type *getLoadStoreType(Value *I) {
+inline Type *getLoadStoreType(const Value *I) {
assert((isa<LoadInst>(I) || isa<StoreInst>(I)) &&
"Expected Load or Store instruction");
if (auto *LI = dyn_cast<LoadInst>(I))
More information about the llvm-commits
mailing list