r203665 - Use vector<T>::data() to simplify code

Dmitri Gribenko gribozavr at gmail.com
Wed Mar 12 08:35:53 PDT 2014


Author: gribozavr
Date: Wed Mar 12 10:35:53 2014
New Revision: 203665

URL: http://llvm.org/viewvc/llvm-project?rev=203665&view=rev
Log:
Use vector<T>::data() to simplify code

Modified:
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=203665&r1=203664&r2=203665&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Wed Mar 12 10:35:53 2014
@@ -2780,9 +2780,7 @@ static void clang_parseTranslationUnit_I
   unsigned NumErrors = Diags->getClient()->getNumErrors();
   std::unique_ptr<ASTUnit> ErrUnit;
   std::unique_ptr<ASTUnit> Unit(ASTUnit::LoadFromCommandLine(
-      Args->size() ? &(*Args)[0] : 0
-          /* vector::data() not portable */,
-      Args->size() ? (&(*Args)[0] + Args->size()) : 0, Diags,
+      Args->data(), Args->data() + Args->size(), Diags,
       CXXIdx->getClangResourcesPath(), CXXIdx->getOnlyLocalDecls(),
       /*CaptureDiagnostics=*/true, *RemappedFiles.get(),
       /*RemappedFilesKeepOriginalName=*/true, PrecompilePreamble, TUKind,





More information about the cfe-commits mailing list