]> granicus.if.org Git - clang/commitdiff
Use array_lengthof instead of sizeof trickery.
authorChad Rosier <mcrosier@apple.com>
Thu, 3 May 2012 21:25:34 +0000 (21:25 +0000)
committerChad Rosier <mcrosier@apple.com>
Thu, 3 May 2012 21:25:34 +0000 (21:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156104 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Compilation.cpp

index 476edeb38ef4e0271f5406413b5c1b982b22f732..c962fca0bf9a2f472313ac55c1cb0d2153b98ca3 100644 (file)
@@ -219,8 +219,7 @@ void Compilation::initCompilationForDiagnostics(void) {
   // to avoid emitting warnings about unused args.
   OptSpecifier OutputOpts[] = { options::OPT_o, options::OPT_MD,
                                 options::OPT_MMD };
-  for (unsigned i = 0, e = sizeof(OutputOpts)/sizeof(OutputOpts[0]); i != e;
-       ++i) {
+  for (unsigned i = 0, e = llvm::array_lengthof(OutputOpts); i != e; ++i) {
     if (TranslatedArgs->hasArg(OutputOpts[i]))
       TranslatedArgs->eraseArg(OutputOpts[i]);
   }