#include "llvm/ExecutionEngine/SectionMemoryManager.h"
-#if defined(LLVM_ON_WIN32) && defined(_WIN64)
+#if defined(_WIN32) && defined(_WIN64)
#define CLANG_INTERPRETER_COFF_FORMAT
#define CLANG_INTERPRETER_WIN_EXCEPTIONS
#endif
DirName != llvm::sys::path::root_path(DirName) &&
llvm::sys::path::is_separator(DirName.back()))
DirName = DirName.substr(0, DirName.size()-1);
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
// Fixing a problem with "clang C:test.c" on Windows.
// Stat("C:") does not recognize "C:" as a valid directory
std::string DirNameStr;
/// "." and "./" in their paths. FIXME: some unittests currently fail on
/// win32 when using remove_dots and remove_leading_dotslash on paths.
bool UseCanonicalizedPaths =
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
false;
#else
true;
ErrorOr<Entry *>
RedirectingFileSystem::lookupPath(sys::path::const_iterator Start,
sys::path::const_iterator End, Entry *From) {
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
assert(!isTraversalComponent(*Start) &&
!isTraversalComponent(From->getName()) &&
"Paths should not contain traversal components");
/// present and lower-casing the string on Windows.
static std::string normalizeProgramName(llvm::StringRef Argv0) {
std::string ProgName = llvm::sys::path::stem(Argv0);
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
// Transform to lowercase for case insensitive file systems.
std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(), ::tolower);
#endif
// forward.
CmdArgs.push_back("-plugin");
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
const char *Suffix = ".dll";
#elif defined(__APPLE__)
const char *Suffix = ".dylib";
// Include the necessary headers to interface with the Windows registry and
// environment.
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
#define USE_WIN32
#endif
return;
}
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
// As a fallback, select default install paths.
// FIXME: Don't guess drives and paths like this on Windows.
const StringRef Paths[] = {
}
const char *Exec =
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
Args.MakeArgString(ToolChain.GetProgramPath("orbis-ld.gold"));
#else
Args.MakeArgString(ToolChain.GetProgramPath("orbis-ld"));
} // end anonymous namespace.
static bool CanPrefixSysroot(StringRef Path) {
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
return !Path.empty() && llvm::sys::path::is_separator(Path[0]);
#else
return llvm::sys::path::is_absolute(Path);
StringRef getInMemoryPreamblePath() {
#if defined(LLVM_ON_UNIX)
return "/__clang_tmp/___clang_inmemory_preamble___";
-#elif defined(LLVM_ON_WIN32)
+#elif defined(_WIN32)
return "C:\\__clang_tmp\\___clang_inmemory_preamble___";
#else
#warning "Unknown platform. Defaulting to UNIX-style paths for in-memory PCHs"
SmallString<128> NormalizedPath;
if (LangOpts.MSVCCompat) {
NormalizedPath = Filename.str();
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
llvm::sys::path::native(NormalizedPath);
#endif
}
// On Windows, abort will return an exit code of 3. In these cases,
// generate additional diagnostic information if possible.
bool DiagnoseCrash = CommandRes < 0 || CommandRes == 70;
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
DiagnoseCrash |= CommandRes == 3;
#endif
if (DiagnoseCrash) {
// results now. This happens in -disable-free mode.
llvm::TimerGroup::printAll(llvm::errs());
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
// Exit status should not be negative on Win32, unless abnormal termination.
// Once abnormal termiation was caught, negative status should not be
// propagated.
fprintf(stderr, "%s\n", clang_getCString(Msg));
clang_disposeString(Msg);
}
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
// On Windows, force a flush, since there may be multiple copies of
// stderr and stdout in the file system, all with different buffers
// but writing to the same device.
#ifdef __CYGWIN__
#include <cygwin/version.h>
#include <sys/cygwin.h>
-#define LLVM_ON_WIN32 1
+#define _WIN32 1
#endif
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
#include <windows.h>
#else
#include <dlfcn.h>
SmallString<128> LibClangPath;
// Find the location where this library lives (libclang.dylib).
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
MEMORY_BASIC_INFORMATION mbi;
char path[MAX_PATH];
VirtualQuery((void *)(uintptr_t)clang_createTranslationUnit, &mbi,
// FIXME: Figure out how to specify paths so the following tests pass on
// Windows.
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
TEST(Matcher, IsExpansionInMainFileMatcher) {
EXPECT_TRUE(matches("class X {};",
"-isystem/", M));
}
-#endif // LLVM_ON_WIN32
+#endif // _WIN32
} // end namespace ast_matchers
} // end namespace clang
llvm::StringMap<FileData, llvm::BumpPtrAllocator> StatCalls;
void InjectFileOrDirectory(const char *Path, ino_t INode, bool IsFile) {
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
SmallString<128> NormalizedPath(Path);
llvm::sys::path::native(NormalizedPath);
Path = NormalizedPath.c_str();
LookupResult getStat(StringRef Path, FileData &Data, bool isFile,
std::unique_ptr<vfs::File> *F,
vfs::FileSystem &FS) override {
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
SmallString<128> NormalizedPath(Path);
llvm::sys::path::native(NormalizedPath);
Path = NormalizedPath.c_str();
statCache->InjectDirectory("/tmp", 42);
statCache->InjectFile("/tmp/test", 43);
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
const char *DirName = "C:.";
const char *FileName = "C:test";
statCache->InjectDirectory(DirName, 44);
ASSERT_TRUE(dir != nullptr);
EXPECT_EQ("/tmp", dir->getName());
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
file = manager.getFile(FileName);
ASSERT_TRUE(file != NULL);
// The following tests apply to Unix-like system only.
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
// getFile() returns the same FileEntry for real files that are aliases.
TEST_F(FileManagerTest, getFileReturnsSameFileEntryForAliasedRealFiles) {
EXPECT_EQ(123, file2->getSize());
}
-#endif // !LLVM_ON_WIN32
+#endif // !_WIN32
TEST_F(FileManagerTest, makeAbsoluteUsesVFS) {
SmallString<64> CustomWorkingDir;
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
CustomWorkingDir = "C:";
#else
CustomWorkingDir = "/";
llvm::raw_string_ostream OS(S);
C->getDefaultToolChain().printVerboseInfo(OS);
}
-#if LLVM_ON_WIN32
+#if _WIN32
std::replace(S.begin(), S.end(), '\\', '/');
#endif
EXPECT_EQ(
llvm::raw_string_ostream OS(S);
C->getDefaultToolChain().printVerboseInfo(OS);
}
-#if LLVM_ON_WIN32
+#if _WIN32
std::replace(S.begin(), S.end(), '\\', '/');
#endif
EXPECT_EQ("Found candidate GCC installation: "
llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> VFS(
new vfs::InMemoryFileSystem());
FileManager FileMgr(FileSystemOptions(), VFS);
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
StringRef Path1 = "a/b/.././c.h";
StringRef Path2 = "a/c.h";
#else
llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> VFS(
new vfs::InMemoryFileSystem());
FileManager FileMgr(FileSystemOptions(), VFS);
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
StringRef Path1 = "./a/b/c.h";
StringRef Path2 = "a/b/c.h";
#else
llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> VFS(
new vfs::InMemoryFileSystem());
FileManager FileMgr(FileSystemOptions(), VFS);
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
StringRef Path1 = "./a/b/c.h";
StringRef Path2 = "a/b/c.h";
#else
bool Matched;
};
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
TEST(newFrontendActionFactory, InjectsSourceFileCallbacks) {
VerifyEndCallback EndCallback;
ArgsAlt);
}
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
TEST(ClangToolTest, BuildASTs) {
FixedCompilationDatabase Compilations("/", std::vector<std::string>());