[cfe-commits] r128138 - /cfe/trunk/lib/Frontend/ASTUnit.cpp

Ted Kremenek kremenek at apple.com
Tue Mar 22 19:16:41 PDT 2011


Author: kremenek
Date: Tue Mar 22 21:16:41 2011
New Revision: 128138

URL: http://llvm.org/viewvc/llvm-project?rev=128138&view=rev
Log:
std::vector::data() is not portable to VS.  Use a gross hack instead.

Modified:
    cfe/trunk/lib/Frontend/ASTUnit.cpp

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=128138&r1=128137&r2=128138&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Tue Mar 22 21:16:41 2011
@@ -1662,7 +1662,9 @@
     TheDriver.setCheckInputsExist(false);
 
     llvm::OwningPtr<driver::Compilation> C(
-      TheDriver.BuildCompilation(Args->size(), Args->data()));
+      TheDriver.BuildCompilation(
+        Args->size(),
+        Args->size() ? &(*Args)[0] : 0 ));  // std::vector::data() not portable
 
     // Just print the cc1 options if -### was present.
     if (C->getArgs().hasArg(driver::options::OPT__HASH_HASH_HASH)) {





More information about the cfe-commits mailing list