From: Daniel Dunbar Date: Sat, 17 Oct 2009 23:53:11 +0000 (+0000) Subject: Attempt to unbreak the MSVC build. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a47dd191719e88e41ce82555685869d2054178e1;p=clang Attempt to unbreak the MSVC build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84381 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 8d09b527b8..6015ffdd4c 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -25,8 +25,10 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/System/Path.h" #include +#ifndef _MSC_VER #include #include +#endif #include using namespace clang; @@ -288,6 +290,10 @@ static const char *clangPath; 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 @@ CXIndex clang_createIndex() 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 @@ CXTranslationUnit clang_createTranslationUnitFromSourceFile( 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 argv; argv.push_back(clangPath); @@ -367,6 +378,7 @@ CXTranslationUnit clang_createTranslationUnitFromSourceFile( clang_createTranslationUnit(CIdx, astTmpFile)); ATU->unlinkTemporaryFile(); return ATU; +#endif } void clang_disposeTranslationUnit(