[llvm] r196400 - llvm-cov: Replace size() with empty() in bool check.

Yuchen Wu yuchenericwu at hotmail.com
Wed Dec 4 11:18:23 PST 2013


Author: ywu
Date: Wed Dec  4 13:18:23 2013
New Revision: 196400

URL: http://llvm.org/viewvc/llvm-project?rev=196400&view=rev
Log:
llvm-cov: Replace size() with empty() in bool check.

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=196400&r1=196399&r2=196400&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Wed Dec  4 13:18:23 2013
@@ -818,14 +818,14 @@ Function *GCOVProfiler::insertCounterWri
     for (unsigned i = 0, e = CU_Nodes->getNumOperands(); i != e; ++i) {
       DICompileUnit CU(CU_Nodes->getOperand(i));
       std::string FilenameGcda = mangleName(CU, "gcda");
-      uint32_t CfgChecksum = FileChecksums.size() ? FileChecksums[i] : 0;
+      uint32_t CfgChecksum = FileChecksums.empty() ? 0 : FileChecksums[i];
       Builder.CreateCall3(StartFile,
                           Builder.CreateGlobalStringPtr(FilenameGcda),
                           Builder.CreateGlobalStringPtr(ReversedVersion),
                           Builder.getInt32(CfgChecksum));
       for (unsigned j = 0, e = CountersBySP.size(); j != e; ++j) {
         DISubprogram SP(CountersBySP[j].second);
-        uint32_t FuncChecksum = Funcs.size() ? Funcs[j]->getFuncChecksum() : 0;
+        uint32_t FuncChecksum = Funcs.empty() ? 0 : Funcs[j]->getFuncChecksum();
         Builder.CreateCall5(
             EmitFunction, Builder.getInt32(j),
             Options.FunctionNamesInData ?





More information about the llvm-commits mailing list