Only add the EH state insertion pass on 32-bit Windows
[oota-llvm.git] / lib / Target / X86 / X86TargetMachine.cpp
index 3e5f1d82202f82ac45db16288154f2bf5011af05..4116cef9b07dfbad9835082df3bd7feaf6a179fd 100644 (file)
@@ -221,9 +221,9 @@ bool X86PassConfig::addILPOpts() {
 }
 
 bool X86PassConfig::addPreISel() {
-  // Only add this pass for 32-bit x86.
+  // Only add this pass for 32-bit x86 Windows.
   Triple TT(TM->getTargetTriple());
-  if (TT.getArch() == Triple::x86)
+  if (TT.isOSWindows() && TT.getArch() == Triple::x86)
     addPass(createX86WinEHStatePass());
   return true;
 }