summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 65e43a2)
raw | patch | inline | side by side (parent: 65e43a2)
author | Jeffrey Yasskin <jyasskin@google.com> | |
Thu, 23 Dec 2010 00:58:24 +0000 (00:58 +0000) | ||
committer | Jeffrey Yasskin <jyasskin@google.com> | |
Thu, 23 Dec 2010 00:58:24 +0000 (00:58 +0000) |
new gcc warning that complains on self-assignments and
self-initializations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122458 91177308-0d34-0410-b5e6-96231b3b80d8
self-initializations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122458 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
diff --git a/include/llvm/Transforms/Utils/AddrModeMatcher.h b/include/llvm/Transforms/Utils/AddrModeMatcher.h
index 61d2c01c729f821d35fba30febf99c8bbe74cad5..0678eccb5d692b0264c6d64439d73b309bdc5b89 100644 (file)
bool Success =
AddressingModeMatcher(AddrModeInsts, TLI, AccessTy,
MemoryInst, Result).MatchAddr(V, 0);
- Success = Success; assert(Success && "Couldn't select *anything*?");
+ (void)Success; assert(Success && "Couldn't select *anything*?");
return Result;
}
private:
index 73ee5cd1c3b605bb53848fa93b96ce8f2c04835b..ded1d0767c6a80b66545925817bb9db5e87edb55 100644 (file)
Val.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, &lost);
// Conversion is always precise.
- status = status;
+ (void)status;
assert(status == APFloat::opOK && !lost &&
"Precision lost during fp16 constfolding");
}
return 0;
}
-
index 9d7bbbd6141cf852adbb1d5aebd3c0e99a3eebcd..8ac0a374a6d13640dbe34a51b79c1040df095979 100644 (file)
InstIt = ReverseMap.find(Inst);
assert(InstIt != ReverseMap.end() && "Reverse map out of sync?");
bool Found = InstIt->second.erase(Val);
- assert(Found && "Invalid reverse map!"); Found=Found;
+ assert(Found && "Invalid reverse map!"); (void)Found;
if (InstIt->second.empty())
ReverseMap.erase(InstIt);
}
index 0875257550bb68e26dde70f2cfce531360dc9e40..b18f62be005c86f925417478985fcdad3b1b78dc 100644 (file)
void RALinScan::DowngradeRegister(LiveInterval *li, unsigned Reg) {
bool isNew = DowngradedRegs.insert(Reg);
- isNew = isNew; // Silence compiler warning.
+ (void)isNew; // Silence compiler warning.
assert(isNew && "Multiple reloads holding the same register?");
DowngradeMap.insert(std::make_pair(li->reg, Reg));
for (const unsigned *AS = tri_->getAliasSet(Reg); *AS; ++AS) {
index 0a2fb3796a4239d65d766a8b094bff42b96238ce..6b7a8c6491bd1b699e067bfe45ffdd9adac8441d 100644 (file)
assert(I->getReg() && "Unknown physical register!");
unsigned VRBase = MRI.createVirtualRegister(SU->CopyDstRC);
bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase)).second;
- isNew = isNew; // Silence compiler warning.
+ (void)isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
BuildMI(*BB, InsertPos, DebugLoc(), TII->get(TargetOpcode::COPY), VRBase)
.addReg(I->getReg());
index c334cf8cf4dbf8110e087266ba7f40c895641290..3402b9fd07243a71059d5c5c854a5cf90e68625a 100644 (file)
if (IsClone)
VRBaseMap.erase(Op);
bool isNew = VRBaseMap.insert(std::make_pair(Op, SrcReg)).second;
- isNew = isNew; // Silence compiler warning.
+ (void)isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
return;
}
if (IsClone)
VRBaseMap.erase(Op);
bool isNew = VRBaseMap.insert(std::make_pair(Op, VRBase)).second;
- isNew = isNew; // Silence compiler warning.
+ (void)isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
}
if (IsClone)
VRBaseMap.erase(Op);
bool isNew = VRBaseMap.insert(std::make_pair(Op, VRBase)).second;
- isNew = isNew; // Silence compiler warning.
+ (void)isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
}
}
SDValue Op(Node, 0);
bool isNew = VRBaseMap.insert(std::make_pair(Op, VRBase)).second;
- isNew = isNew; // Silence compiler warning.
+ (void)isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
}
SDValue Op(Node, 0);
bool isNew = VRBaseMap.insert(std::make_pair(Op, NewVReg)).second;
- isNew = isNew; // Silence compiler warning.
+ (void)isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
}
MBB->insert(InsertPos, MI);
SDValue Op(Node, 0);
bool isNew = VRBaseMap.insert(std::make_pair(Op, NewVReg)).second;
- isNew = isNew; // Silence compiler warning.
+ (void)isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
}
index 9b7f553ed41049ed2658ed66af8020cea5a5dde8..4a6ae60b9a8b30ebc0426900a03f27a86aecb97d 100644 (file)
} else {
SmallVector<MachineInstr*, 4> NewMIs;
bool Success = TII->unfoldMemoryOperand(MF, MI, Reg, false, false, NewMIs);
- Success = Success; // Silence compiler warning.
+ (void)Success; // Silence compiler warning.
assert(Success && "Failed to unfold!");
MachineInstr *NewMI = NewMIs[0];
MBB->insert(MI, NewMI);
index cd7c097d35dcd42fc8400a1bf3ec38d597478759..a9f4709e4b93df939e16717882260a605cb005a9 100644 (file)
PrettyStackTraceEntry::PrettyStackTraceEntry() {
// The first time this is called, we register the crash printer.
static bool HandlerRegistered = RegisterCrashPrinter();
- HandlerRegistered = HandlerRegistered;
+ (void)HandlerRegistered;
// Link ourselves.
NextEntry = PrettyStackTraceHead.get();
OS << ArgV[i] << ' ';
OS << '\n';
}
-
index 6f28277890e3978016343e4d22e350377ae37457..90ec299502629b5c0f47e91fd165c30e18b71477 100644 (file)
void StringMapImpl::RemoveKey(StringMapEntryBase *V) {
const char *VStr = (char*)V + ItemSize;
StringMapEntryBase *V2 = RemoveKey(StringRef(VStr, V->getKeyLength()));
- V2 = V2;
+ (void)V2;
assert(V == V2 && "Didn't find key?");
}
index dba819cb5201c8515ffc66238e6899590132381c..755e04df63becb1714e135f57ae2a274c99531a3 100644 (file)
case ISD::SUBE:
case ISD::ADDE: {
SDValue InFlag = Node->getOperand(2), CmpLHS;
- unsigned Opc = InFlag.getOpcode(); Opc=Opc;
+ unsigned Opc = InFlag.getOpcode(); (void)Opc;
assert(((Opc == ISD::ADDC || Opc == ISD::ADDE) ||
(Opc == ISD::SUBC || Opc == ISD::SUBE)) &&
"(ADD|SUB)E flag operand must come from (ADD|SUB)C/E insn");
index 783ac1241ee0194812b8e42488f6658ebd42d09d..0367ca62b6e97dcd3345848c835367ac3e56174d 100644 (file)
VT = LD->getMemoryVT();
} else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ST = ST;
Ptr = ST->getBasePtr();
VT = ST->getMemoryVT();
} else
index a92e848b845bbf74cdacc55c49855b7fed2f4a51..6dcb49f93586b73fe6f712b2d190d623a0e98403 100644 (file)
DEBUG(dbgs() << "Replace stores:\n";
for (unsigned i = 0, e = Range.TheStores.size(); i != e; ++i)
dbgs() << *Range.TheStores[i] << '\n';
- dbgs() << "With: " << *C << '\n'); C=C;
+ dbgs() << "With: " << *C << '\n'); (void)C;
// Don't invalidate the iterator
BBI = BI;
MD = 0;
return MadeChange;
}
-
-
-
index b1cef965035e6815afd61cf7c2cd9b4d0e89985f..be7bed1cecdf0cc34ad355c931a9be0b5f8bb2e9 100644 (file)
MemoryInst, Result);
Matcher.IgnoreProfitability = true;
bool Success = Matcher.MatchAddr(Address, 0);
- Success = Success; assert(Success && "Couldn't select *anything*?");
+ (void)Success; assert(Success && "Couldn't select *anything*?");
// If the match didn't cover I, then it won't be shared by it.
if (std::find(MatchedAddrModeInsts.begin(), MatchedAddrModeInsts.end(),
index 8e82a02caa6902caa0e7967b77823fa55cf509b4..8cc26492c292343ec674429eebd79007048f0947 100644 (file)
for (unsigned i = 0, e = P->getNumIncomingValues(); i < e; ++i) {
if (InvokeInst *II = dyn_cast<InvokeInst>(P->getIncomingValue(i))) {
assert(II->getParent() != P->getIncomingBlock(i) &&
- "Invoke edge not supported yet"); II=II;
+ "Invoke edge not supported yet"); (void)II;
}
new StoreInst(P->getIncomingValue(i), Slot,
P->getIncomingBlock(i)->getTerminator());
index 1892c009e22450894bd537a57d99b2e2d91ecf52..efa390fe2aa75e33533537c17f937e9581c5bb54 100644 (file)
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
- FTy = FTy; // silence warning.
+ (void)FTy; // silence warning.
assert((NumParams == FTy->getNumParams() ||
(FTy->isVarArg() && NumParams > FTy->getNumParams())) &&
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
- FTy = FTy; // silence warning.
+ (void)FTy; // silence warning.
assert((FTy->getNumParams() == 2 ||
(FTy->isVarArg() && FTy->getNumParams() < 2)) &&
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
- FTy = FTy; // silence warning.
+ (void)FTy; // silence warning.
assert((FTy->getNumParams() == 1 ||
(FTy->isVarArg() && FTy->getNumParams() == 0)) &&
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
- FTy = FTy; // silence warning.
+ (void)FTy; // silence warning.
assert(FTy->getNumParams() == 0 && "Calling a function with bad signature");
}
Op<-1>() = IfException;
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Fn->getType())->getElementType());
- FTy = FTy; // silence warning.
+ (void)FTy; // silence warning.
assert(((NumArgs == FTy->getNumParams()) ||
(FTy->isVarArg() && NumArgs > FTy->getNumParams())) &&
void BinaryOperator::init(BinaryOps iType) {
Value *LHS = getOperand(0), *RHS = getOperand(1);
- LHS = LHS; RHS = RHS; // Silence warnings.
+ (void)LHS; (void)RHS; // Silence warnings.
assert(LHS->getType() == RHS->getType() &&
"Binary operator operand types must match!");
#ifndef NDEBUG
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 395ca566498aa107b917fe032bc90464a01c35e4..be28ad1f71226bffbdaef9a93f89b081ca0c4b81 100644 (file)
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
while (!AbstractTypeUsers.empty() && NewTy != this) {
AbstractTypeUser *User = AbstractTypeUsers.back();
- unsigned OldSize = AbstractTypeUsers.size(); OldSize=OldSize;
+ unsigned OldSize = AbstractTypeUsers.size(); (void)OldSize;
#ifdef DEBUG_MERGE_TYPES
DEBUG(dbgs() << " REFINING user " << OldSize-1 << "[" << (void*)User
<< "] of abstract type [" << (void*)this << " "
DEBUG(dbgs() << "typeIsREFINED type: " << (void*)this << " " << *this <<"\n");
#endif
- unsigned OldSize = AbstractTypeUsers.size(); OldSize=OldSize;
+ unsigned OldSize = AbstractTypeUsers.size(); (void)OldSize;
while (!AbstractTypeUsers.empty()) {
AbstractTypeUser *ATU = AbstractTypeUsers.back();
ATU->typeBecameConcrete(this);
index 5a90917977b024257784811b6c0521421e02ffec..4694486c41b634c6614caec32cf612cf336a6d23 100644 (file)
// The old record is now out-of-date, because one of the children has been
// updated. Remove the obsolete entry from the map.
unsigned NumErased = Map.erase(ValType::get(Ty));
- assert(NumErased && "Element not found!"); NumErased = NumErased;
+ assert(NumErased && "Element not found!"); (void)NumErased;
// Remember the structural hash for the type before we start hacking on it,
// in case we need it later.
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 76cfb9082a52374e0c57e8e36df4f75c15ddf108..36e6b4c070e75bd2be433d3f2bb3091587091ff6 100644 (file)
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
// Get V's ST, this should always succed, because V has a name.
ValueSymbolTable *VST;
bool Failure = getSymTab(V, VST);
- assert(!Failure && "V has a name, so it should have a ST!"); Failure=Failure;
+ assert(!Failure && "V has a name, so it should have a ST!"); (void)Failure;
// If these values are both in the same symtab, we can do this very fast.
// This works even if both values have no symtab yet.
index ba610ea4ff9a557ad8bb3ae46b0128a712108259..2e5e5b167c4105f35d8bd24d56b4a60fec2fcfac 100644 (file)
TEST_F(ValueHandle, AssertingVH_BasicOperation) {
AssertingVH<CastInst> AVH(BitcastV.get());
CastInst *implicit_to_exact_type = AVH;
- implicit_to_exact_type = implicit_to_exact_type; // Avoid warning.
+ (void)implicit_to_exact_type; // Avoid warning.
AssertingVH<Value> GenericAVH(BitcastV.get());
EXPECT_EQ(BitcastV.get(), GenericAVH);
const CastInst *ConstBitcast = BitcastV.get();
AssertingVH<const CastInst> AVH(ConstBitcast);
const CastInst *implicit_to_exact_type = AVH;
- implicit_to_exact_type = implicit_to_exact_type; // Avoid warning.
+ (void)implicit_to_exact_type; // Avoid warning.
}
TEST_F(ValueHandle, AssertingVH_Comparisons) {
index 9d0f3fdbae97d7e0779c2a88169adb9bc25fabef..5625fe4d2bff978b8edf8bf4e6416c0aadb4a986 100644 (file)
o << " const unsigned opcode = MI.getOpcode();\n"
<< " unsigned Value = InstBits[opcode];\n"
<< " unsigned op = 0;\n"
- << " op = op; // suppress warning\n"
+ << " (void)op; // suppress warning\n"
<< " switch (opcode) {\n";
// Emit each case statement