[llvm] r372598 - Function::BuildLazyArguments() - fix "variable used but never read" analyzer warning. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 23 05:49:39 PDT 2019
Author: rksimon
Date: Mon Sep 23 05:49:39 2019
New Revision: 372598
URL: http://llvm.org/viewvc/llvm-project?rev=372598&view=rev
Log:
Function::BuildLazyArguments() - fix "variable used but never read" analyzer warning. NFCI.
Simplify the code by separating the masking of the SDC variable from using it.
Modified:
llvm/trunk/lib/IR/Function.cpp
Modified: llvm/trunk/lib/IR/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Function.cpp?rev=372598&r1=372597&r2=372598&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Function.cpp (original)
+++ llvm/trunk/lib/IR/Function.cpp Mon Sep 23 05:49:39 2019
@@ -293,7 +293,8 @@ void Function::BuildLazyArguments() cons
// Clear the lazy arguments bit.
unsigned SDC = getSubclassDataFromValue();
- const_cast<Function*>(this)->setValueSubclassData(SDC &= ~(1<<0));
+ SDC &= ~(1 << 0);
+ const_cast<Function*>(this)->setValueSubclassData(SDC);
assert(!hasLazyArguments());
}
More information about the llvm-commits
mailing list