HelpText<"Include precompiled header file">;
def include_pth : Separate<"-include-pth">, MetaVarName<"<file>">,
HelpText<"Include file before parsing">;
+def use_preamble_EQ : Joined<"-use-preamble=">,
+ HelpText<"Assume that the precompiled header is a precompiled preamble "
+ "covering the first N bytes of the main file">;
def token_cache : Separate<"-token-cache">, MetaVarName<"<path>">,
HelpText<"Use specified token cache file">;
def U : JoinedOrSeparate<"-U">, MetaVarName<"<macro>">,
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/System/Program.h"
+#include <cstdlib>
+#include <cstdio>
#ifdef UDP_CODE_COMPLETION_LOGGER
#include "clang/Basic/Version.h"
#endif
#endif
+ bool EnableLogging = getenv("LIBCLANG_CODE_COMPLETION_LOGGING") != 0;
+
// The indexer, which is mainly used to determine where diagnostics go.
CIndexer *CXXIdx = static_cast<CIndexer *>(CIdx);
argv.push_back(arg);
}
+ if (EnableLogging) {
+ std::string Log = ClangPath.str();
+ for (unsigned I = 0, N = argv.size(); I != N; ++I) {
+ Log += ' ';
+ Log += argv[I];
+ }
+ fprintf(stderr, "libclang (Code Completion): %s\n", Log.c_str());
+ }
+
// Add the null terminator.
argv.push_back(NULL);
llvm::sys::Path DiagnosticsFile(tmpResultsFileName);
TemporaryFiles.push_back(DiagnosticsFile);
+
+
// Invoke 'clang'.
llvm::sys::Path DevNull; // leave empty, causes redirection to /dev/null
// on Unix or NUL (Windows).