[cfe-commits] r84381 - /cfe/trunk/tools/CIndex/CIndex.cpp

Daniel Dunbar daniel at zuster.org
Sat Oct 17 16:53:11 PDT 2009


Author: ddunbar
Date: Sat Oct 17 18:53:11 2009
New Revision: 84381

URL: http://llvm.org/viewvc/llvm-project?rev=84381&view=rev
Log:
Attempt to unbreak the MSVC build.

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

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=84381&r1=84380&r2=84381&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Sat Oct 17 18:53:11 2009
@@ -25,8 +25,10 @@
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/System/Path.h"
 #include <cstdio>
+#ifndef _MSC_VER
 #include <dlfcn.h>
 #include <sys/wait.h>
+#endif
 #include <vector>
 
 using namespace clang;
@@ -288,6 +290,10 @@
 
 CXIndex clang_createIndex() 
 {
+  // FIXME: This is a hack to unbreak the MSVC build.
+#ifdef _MSC_VER
+  llvm::sys::Path CIndexPath("");
+#else
   // Find the location where this library lives (libCIndex.dylib).
   // We do the lookup here to avoid poking dladdr too many times.
   // This silly cast below avoids a C++ warning.
@@ -296,6 +302,7 @@
     assert(0 && "Call to dladdr() failed");
 
   llvm::sys::Path CIndexPath(info.dli_fname);
+#endif
   std::string CIndexDir = CIndexPath.getDirname();
   
   // We now have the CIndex directory, locate clang relative to it.
@@ -332,6 +339,10 @@
   const char *source_filename,
   int num_command_line_args, const char **command_line_args) 
 {
+  // FIXME: This is a hack to unbreak the build.
+#ifdef _MSC_VER
+  return 0;
+#else
   // Build up the arguments for involing clang.
   std::vector<const char *> argv;
   argv.push_back(clangPath);
@@ -367,6 +378,7 @@
                    clang_createTranslationUnit(CIdx, astTmpFile));
   ATU->unlinkTemporaryFile();
   return ATU;
+#endif
 }
 
 void clang_disposeTranslationUnit(





More information about the cfe-commits mailing list