aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantFold.cpp
diff options
context:
space:
mode:
authorJie Fu <jiefu@tencent.com>2023-11-14 16:57:24 +0800
committerJie Fu <jiefu@tencent.com>2023-11-14 16:57:24 +0800
commite582fe64449b56005b945a32cc06e70bd8ef6ab1 (patch)
treeecaf7b8c296d5d4e8b572f44f1d5ad7ed259bab9 /llvm/lib/IR/ConstantFold.cpp
parent47eeee297775347cbdb7624d6a766c2a3eec4a59 (diff)
downloadllvm-e582fe64449b56005b945a32cc06e70bd8ef6ab1.zip
llvm-e582fe64449b56005b945a32cc06e70bd8ef6ab1.tar.gz
llvm-e582fe64449b56005b945a32cc06e70bd8ef6ab1.tar.bz2
[llvm] Fix -Wunused-variable in ConstantFold.cpp (NFC)
/llvm-project/llvm/lib/IR/ConstantFold.cpp:137:12: error: unused variable 'CSize' [-Werror,-Wunused-variable] unsigned CSize = cast<IntegerType>(C->getType())->getBitWidth()/8; ^ 1 error generated.
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 25f7ac2..d499d74 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -134,7 +134,7 @@ static Constant *ExtractConstantBytes(Constant *C, unsigned ByteStart,
assert(C->getType()->isIntegerTy() &&
(cast<IntegerType>(C->getType())->getBitWidth() & 7) == 0 &&
"Non-byte sized integer input");
- unsigned CSize = cast<IntegerType>(C->getType())->getBitWidth()/8;
+ [[maybe_unused]] unsigned CSize = cast<IntegerType>(C->getType())->getBitWidth()/8;
assert(ByteSize && "Must be accessing some piece");
assert(ByteStart+ByteSize <= CSize && "Extracting invalid piece from input");
assert(ByteSize != CSize && "Should not extract everything");