bool Archive::isBitcodeArchive() {
// Make sure the symTab has been loaded. In most cases this should have been
// done when the archive was constructed, but still, this is just in case.
- if (!symTab.size())
+ if (symTab.empty())
if (!loadSymbolTable(0))
return false;
}
case bitc::FUNC_CODE_INST_RET: // RET: [opty,opval<optional>]
- if (Record.size() == 0) {
+ if (Record.empty()) {
I = new ReturnInst();
break;
} else {
if (Stream.AtEndOfStream())
return;
- assert (Record.size() == 0);
+ assert (Record.empty());
assert (AbbrevNo >= bitc::UNABBREV_RECORD);
RecordCode = Stream.ReadRecord(AbbrevNo,Record);
assert (Record.size() > 0);
} else if (FBB) {
if (TBB!=IBB && FBB!=IBB) // cbr then ubr
continue;
- } else if (Cond.size() == 0) {
+ } else if (Cond.empty()) {
if (TBB!=IBB) // ubr
continue;
} else {
// Look for root nodes, i.e. blocks without successors.
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
- if (I->succ_size() == 0)
+ if (I->succ_empty())
Roots.push_back(I);
std::vector<IfcvtToken*> Tokens;
unsigned Size = TrueBBI.NonPredSize;
if (TrueBBI.IsBrAnalyzable) {
- if (TrueBBI.TrueBB && TrueBBI.BrCond.size() == 0)
+ if (TrueBBI.TrueBB && TrueBBI.BrCond.empty())
// End with an unconditional branch. It will be removed.
--Size;
else {
ScanInstructions(BBI);
// Unanalyable or ends with fallthrough or unconditional branch.
- if (!BBI.IsBrAnalyzable || BBI.BrCond.size() == 0) {
+ if (!BBI.IsBrAnalyzable || BBI.BrCond.empty()) {
BBI.IsBeingAnalyzed = false;
BBI.IsAnalyzed = true;
return BBI;
}
// Remove landing pads with no try-ranges.
- if (!LandingPads[i].BeginLabels.size()) {
+ if (LandingPads[i].BeginLabels.empty()) {
LandingPads.erase(LandingPads.begin() + i);
continue;
}
// If we've change things around then replace token factor.
if (Changed) {
- if (Ops.size() == 0) {
+ if (Ops.empty()) {
// The entry token is the only possible outcome.
Result = DAG.getEntryNode();
} else {
void ScheduleDAG::CalculateDepths() {
std::vector<std::pair<SUnit*, unsigned> > WorkList;
for (unsigned i = 0, e = SUnits.size(); i != e; ++i)
- if (SUnits[i].Preds.size() == 0)
+ if (SUnits[i].Preds.empty())
WorkList.push_back(std::make_pair(&SUnits[i], 0U));
while (!WorkList.empty()) {
// All leaves to Available queue.
for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
// It is available if it has no predecessors.
- if (SUnits[i].Preds.size() == 0 && &SUnits[i] != Entry) {
+ if (SUnits[i].Preds.empty() && &SUnits[i] != Entry) {
AvailableQueue->push(&SUnits[i]);
SUnits[i].isAvailable = SUnits[i].isPending = true;
}
std::vector<std::pair<const SUnit*, unsigned> > WorkList;
for (unsigned i = 0, e = SUnits->size(); i != e; ++i) {
const SUnit *SU = &(*SUnits)[i];
- if (SU->Succs.size() == 0)
+ if (SU->Succs.empty())
WorkList.push_back(std::make_pair(SU, 0U));
}
// All leaves to Available queue.
for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
// It is available if it has no predecessors.
- if (SUnits[i].Preds.size() == 0 && &SUnits[i] != Entry) {
+ if (SUnits[i].Preds.empty() && &SUnits[i] != Entry) {
AvailableQueue->push(&SUnits[i]);
SUnits[i].isAvailable = true;
}
bool SDNode::hasAnyUseOfValue(unsigned Value) const {
assert(Value < getNumValues() && "Bad value!");
- if (use_size() == 0) return false;
+ if (use_empty()) return false;
SDOperand TheValue(const_cast<SDNode *>(this), Value);
// double drand48()
GenericValue lle_X_drand48(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 0);
+ assert(Args.empty());
GenericValue GV;
GV.DoubleVal = drand48();
return GV;
// long lrand48()
GenericValue lle_X_lrand48(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 0);
+ assert(Args.empty());
GenericValue GV;
GV.IntVal = APInt(32, lrand48());
return GV;
// int rand()
GenericValue lle_X_rand(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 0);
+ assert(Args.empty());
GenericValue GV;
GV.IntVal = APInt(32, rand());
return GV;
bool
Path::set(const std::string& a_path) {
- if (a_path.size() == 0)
+ if (a_path.empty())
return false;
std::string save(path);
path = a_path;
// If the constant string's length is zero we can optimize this by just
// doing a store of 0 at the first byte of the destination
- if (SrcStr.size() == 0) {
+ if (SrcStr.empty()) {
new StoreInst(ConstantInt::get(Type::Int8Ty, 0), Dst, CI);
return ReplaceCallWith(CI, Dst);
}
while (isa<PHINode>(InsertPt)) ++InsertPt;
ExitBlocks[0]->getInstList().insert(InsertPt, &I);
}
- } else if (ExitBlocks.size() == 0) {
+ } else if (ExitBlocks.empty()) {
// The instruction is actually dead if there ARE NO exit blocks.
CurAST->deleteValue(&I);
if (!I.use_empty()) // If I has users in unreachable blocks, eliminate.
Loop *L,
bool isOnlyStride) {
// If all the users are moved to another stride, then there is nothing to do.
- if (Uses.Users.size() == 0)
+ if (Uses.Users.empty())
return;
// Keep track if every use in UsersToProcess is an address. If they all are,
++NumFactor;
- if (Ops.size() == 0)
+ if (Ops.empty())
return V2;
// Add the new value to the list of things being added.