[compiler-rt] r254673 - Don't shadow a variable in the outer scope. Use canonical form of the

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 16:40:07 PST 2015


Author: joerg
Date: Thu Dec  3 18:40:07 2015
New Revision: 254673

URL: http://llvm.org/viewvc/llvm-project?rev=254673&view=rev
Log:
Don't shadow a variable in the outer scope. Use canonical form of the
array size idiom.

Modified:
    compiler-rt/trunk/lib/profile/InstrProfilingWriter.c

Modified: compiler-rt/trunk/lib/profile/InstrProfilingWriter.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingWriter.c?rev=254673&r1=254672&r2=254673&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingWriter.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingWriter.c Thu Dec  3 18:40:07 2015
@@ -59,11 +59,11 @@ LLVM_LIBRARY_VISIBILITY int llvmWritePro
       {CountersBegin, sizeof(uint64_t), CountersSize},
       {NamesBegin, sizeof(char), NamesSize},
       {Zeroes, sizeof(char), Padding}};
-  if (Writer(IOVec, sizeof(IOVec) / sizeof(ProfDataIOVec), &WriterCtx))
+  if (Writer(IOVec, sizeof(IOVec) / sizeof(*IOVec), &WriterCtx))
     return -1;
   if (ValueDataBegin) {
-    ProfDataIOVec IOVec[1] = {{ValueDataBegin, sizeof(char), ValueDataSize}};
-    if (Writer(IOVec, 1, &WriterCtx))
+    ProfDataIOVec IOVec2[] = {{ValueDataBegin, sizeof(char), ValueDataSize}};
+    if (Writer(IOVec2, sizeof(IOVec2) / sizeof(*IOVec2), &WriterCtx))
       return -1;
   }
   return 0;




More information about the llvm-commits mailing list