Avoid use of size(), which counts, in favor of other mechanisms.
authorReid Spencer <rspencer@reidspencer.com>
Sun, 25 Jul 2004 21:44:54 +0000 (21:44 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 25 Jul 2004 21:44:54 +0000 (21:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15221 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index 4d055e786ab2434fb6df578cc196f6c9d2937053..df5cabc75697289c429dd6a398ed3a7cf047bf3e 100644 (file)
@@ -732,14 +732,15 @@ void AssemblyWriter::printModule(const Module *M) {
   case Module::Pointer64:    Out << "target pointersize = 64\n"; break;
   case Module::AnyPointerSize: break;
   }
-  if (M->getTargetTriple().size() > 0)
+  if (!M->getTargetTriple().empty())
     Out << "target triple = \"" << M->getTargetTriple() << "\"\n";
   
   // Loop over the dependent libraries and emit them
-  if (M->lib_size() > 0) {
+  Module::lib_iterator LI= M->lib_begin();
+  Module::lib_iterator LE= M->lib_end();
+  if (LI != LE) {
     Out << "deplibs = [\n";
-    for (Module::lib_iterator LI = M->lib_begin(), LE = M->lib_end(); 
-         LI != LE; ) {
+    while ( LI != LE ) {
       Out << "\"" << *LI << "\"";
       ++LI;
       if ( LI != LE )