[llvm-commits] [dragonegg] r130194 - /dragonegg/trunk/src/Constants.cpp
Duncan Sands
baldrick at free.fr
Tue Apr 26 01:16:57 PDT 2011
Author: baldrick
Date: Tue Apr 26 03:16:57 2011
New Revision: 130194
URL: http://llvm.org/viewvc/llvm-project?rev=130194&view=rev
Log:
Avoid warnings about unused variables.
Modified:
dragonegg/trunk/src/Constants.cpp
Modified: dragonegg/trunk/src/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Constants.cpp?rev=130194&r1=130193&r2=130194&view=diff
==============================================================================
--- dragonegg/trunk/src/Constants.cpp (original)
+++ dragonegg/trunk/src/Constants.cpp Tue Apr 26 03:16:57 2011
@@ -161,9 +161,11 @@
unsigned deltaFirst = R.getFirst() - r.getFirst();
unsigned deltaLast = r.getLast() - R.getLast();
if (BYTES_BIG_ENDIAN && deltaLast) {
+ (void)deltaFirst; // Avoid unused variable warning.
Constant *ShiftAmt = ConstantInt::get(C->getType(), deltaLast);
C = TheFolder->CreateShl(C, ShiftAmt);
} else if (!BYTES_BIG_ENDIAN && deltaFirst) {
+ (void)deltaLast; // Avoid unused variable warning.
Constant *ShiftAmt = ConstantInt::get(C->getType(), deltaFirst);
C = TheFolder->CreateShl(C, ShiftAmt);
}
@@ -215,16 +217,17 @@
// The extra bits added when extending a slice may contain anything. In each
// extended slice clear the bits corresponding to the other slice.
- int HullFirst = Hull.getFirst(), HullLast = Hull.getLast();
unsigned HullWidth = Hull.getWidth();
// Compute masks with the bits for each slice set to 1.
APInt ThisBits, OtherBits;
if (BYTES_BIG_ENDIAN) {
+ int HullLast = Hull.getLast();
ThisBits = APInt::getBitsSet(HullWidth, HullLast - getLast(),
HullLast - getFirst());
OtherBits = APInt::getBitsSet(HullWidth, HullLast - other.getLast(),
HullLast - other.getFirst());
} else {
+ int HullFirst = Hull.getFirst();
ThisBits = APInt::getBitsSet(HullWidth, getFirst() - HullFirst,
getLast() - HullFirst);
OtherBits = APInt::getBitsSet(HullWidth, other.getFirst() - HullFirst,
@@ -256,9 +259,11 @@
unsigned deltaFirst = r.getFirst() - R.getFirst();
unsigned deltaLast = R.getLast() - r.getLast();
if (BYTES_BIG_ENDIAN && deltaLast) {
+ (void)deltaFirst; // Avoid unused variable warning.
Constant *ShiftAmt = ConstantInt::get(C->getType(), deltaLast);
C = TheFolder->CreateLShr(C, ShiftAmt);
} else if (!BYTES_BIG_ENDIAN && deltaFirst) {
+ (void)deltaLast; // Avoid unused variable warning.
Constant *ShiftAmt = ConstantInt::get(C->getType(), deltaFirst);
C = TheFolder->CreateLShr(C, ShiftAmt);
}
@@ -1122,9 +1127,9 @@
static Constant *ConvertBinOp_CST(tree exp) {
Constant *LHS = ConvertInitializer(TREE_OPERAND(exp, 0));
- bool LHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp,0)));
+ bool LHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0)));
Constant *RHS = ConvertInitializer(TREE_OPERAND(exp, 1));
- bool RHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp,1)));
+ bool RHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1)));
Instruction::CastOps opcode;
if (LHS->getType()->isPointerTy()) {
const Type *IntPtrTy = getTargetData().getIntPtrType(Context);
More information about the llvm-commits
mailing list