mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
Replace size() calls on containers with empty() calls where appropriate. NFC
http://reviews.llvm.org/D7090 Patch by Gábor Horváth! llvm-svn: 226914
This commit is contained in:
parent
d486e09d8e
commit
6ee521c7eb
@ -55,7 +55,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (args.size() && args[0] == "help")
|
||||
if (!args.empty() && args[0] == "help")
|
||||
PrintHelp(llvm::errs());
|
||||
|
||||
return true;
|
||||
|
@ -432,7 +432,7 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
|
||||
BackendArgs.data());
|
||||
|
||||
std::string FeaturesStr;
|
||||
if (TargetOpts.Features.size()) {
|
||||
if (!TargetOpts.Features.empty()) {
|
||||
SubtargetFeatures Features;
|
||||
for (std::vector<std::string>::const_iterator
|
||||
it = TargetOpts.Features.begin(),
|
||||
|
@ -2366,7 +2366,7 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
|
||||
std::vector<llvm::Constant*> Elements;
|
||||
llvm::Constant *Statics = NULLPtr;
|
||||
// Generate statics list:
|
||||
if (ConstantStrings.size()) {
|
||||
if (!ConstantStrings.empty()) {
|
||||
llvm::ArrayType *StaticsArrayTy = llvm::ArrayType::get(PtrToInt8Ty,
|
||||
ConstantStrings.size() + 1);
|
||||
ConstantStrings.push_back(NULLPtr);
|
||||
|
@ -6945,7 +6945,7 @@ CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU) {
|
||||
|
||||
CXTUResourceUsage usage = { (void*) entries.get(),
|
||||
(unsigned) entries->size(),
|
||||
entries->size() ? &(*entries)[0] : nullptr };
|
||||
!entries->empty() ? &(*entries)[0] : nullptr };
|
||||
entries.release();
|
||||
return usage;
|
||||
}
|
||||
|
@ -1207,7 +1207,7 @@ writePrettyPrintFunction(Record &R,
|
||||
static unsigned
|
||||
getSpellingListIndex(const std::vector<FlattenedSpelling> &SpellingList,
|
||||
const FlattenedSpelling &Spelling) {
|
||||
assert(SpellingList.size() && "Spelling list is empty!");
|
||||
assert(!SpellingList.empty() && "Spelling list is empty!");
|
||||
|
||||
for (unsigned Index = 0; Index < SpellingList.size(); ++Index) {
|
||||
const FlattenedSpelling &S = SpellingList[Index];
|
||||
@ -1231,7 +1231,7 @@ static void writeAttrAccessorDefinition(const Record &R, raw_ostream &OS) {
|
||||
std::vector<FlattenedSpelling> Spellings =
|
||||
GetFlattenedSpellings(*Accessor);
|
||||
std::vector<FlattenedSpelling> SpellingList = GetFlattenedSpellings(R);
|
||||
assert(SpellingList.size() &&
|
||||
assert(!SpellingList.empty() &&
|
||||
"Attribute with empty spelling list can't have accessors!");
|
||||
|
||||
OS << " bool " << Name << "() const { return SpellingListIndex == ";
|
||||
|
@ -1393,7 +1393,7 @@ void Intrinsic::emitBody(StringRef CallPrefix) {
|
||||
}
|
||||
}
|
||||
|
||||
assert(Lines.size() && "Empty def?");
|
||||
assert(!Lines.empty() && "Empty def?");
|
||||
if (!RetVar.getType().isVoid())
|
||||
Lines.back().insert(0, RetVar.getName() + " = ");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user