]> granicus.if.org Git - clang/commitdiff
Fix crash with x86_64-pc-win32-macho target. <rdar://problem/17235840>
authorBob Wilson <bob.wilson@apple.com>
Tue, 10 Jun 2014 21:07:12 +0000 (21:07 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 10 Jun 2014 21:07:12 +0000 (21:07 +0000)
The changes in r204978 broke win32-macho targets. There were checks added for
MSVC and Itanium environments as special cases, and win32-macho needs to be
treated the same way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210584 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/InitHeaderSearch.cpp
test/Misc/win32-macho.c [new file with mode: 0644]

index d2890f0857c402f783a316075ad6b5264c34dfb2..d2edc9479f6b7cb432aaaf2658c41149d73102ad 100644 (file)
@@ -472,7 +472,8 @@ void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang,
 
   case llvm::Triple::Win32:
     if (triple.getEnvironment() == llvm::Triple::MSVC ||
-        triple.getEnvironment() == llvm::Triple::Itanium)
+        triple.getEnvironment() == llvm::Triple::Itanium ||
+        triple.getObjectFormat() == llvm::Triple::MachO)
       return;
     break;
   }
diff --git a/test/Misc/win32-macho.c b/test/Misc/win32-macho.c
new file mode 100644 (file)
index 0000000..2879ba4
--- /dev/null
@@ -0,0 +1,2 @@
+// Check that basic use of win32-macho targets works.
+// RUN: %clang -c -target x86_64-pc-win32-macho %s