[llvm] r281982 - Remove a use of subtarget initialization in the X86 backend so we can get rid of the default subtarget.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 09:04:59 PDT 2016


Author: echristo
Date: Tue Sep 20 11:04:59 2016
New Revision: 281982

URL: http://llvm.org/viewvc/llvm-project?rev=281982&view=rev
Log:
Remove a use of subtarget initialization in the X86 backend so we can get rid of the default subtarget.

NFC intended.

Modified:
    llvm/trunk/lib/Target/X86/X86TargetMachine.cpp

Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=281982&r1=281981&r2=281982&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Tue Sep 20 11:04:59 2016
@@ -159,7 +159,10 @@ X86TargetMachine::X86TargetMachine(const
   // (which on X86, happens to be the 'ud2' instruction)
   // On PS4, the "return address" of a 'noreturn' call must still be within
   // the calling function, and TrapUnreachable is an easy way to get that.
-  if (Subtarget.isTargetWin64() || Subtarget.isTargetPS4())
+  // The check here for 64-bit windows is a bit icky, but as we're unlikely
+  // to ever want to mix 32 and 64-bit windows code in a single module
+  // this should be fine.
+  if ((TT.isOSWindows() && TT.getArch() == Triple::x86_64) || TT.isPS4())
     this->Options.TrapUnreachable = true;
 
   // By default (and when -ffast-math is on), enable estimate codegen for




More information about the llvm-commits mailing list