Move the setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand) and
authorDan Gohman <gohman@apple.com>
Tue, 25 Sep 2007 15:10:49 +0000 (15:10 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 25 Sep 2007 15:10:49 +0000 (15:10 +0000)
the check to see if the assembler supports .loc from X86TargetLowering
into the superclass TargetLowering.

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

lib/CodeGen/SelectionDAG/TargetLowering.cpp
lib/Target/X86/X86ISelLowering.cpp

index 5943cc1ebd362e415f6bf0a0df27884584810a97..0898173ef9e0c656339d7b5709593cad93a31d9c 100644 (file)
@@ -20,6 +20,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/MathExtras.h"
+#include "llvm/Target/TargetAsmInfo.h"
 using namespace llvm;
 
 /// InitLibcallNames - Set default libcall names.
@@ -169,6 +170,10 @@ TargetLowering::TargetLowering(TargetMachine &tm)
 
   InitLibcallNames(LibcallRoutineNames);
   InitCmpLibcallCCs(CmpLibcallCCs);
+
+  // Tell Legalize whether the assembler supports DEBUG_LOC.
+  if (!TM.getTargetAsmInfo()->hasDotLocAndDotFile())
+    setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
 }
 
 TargetLowering::~TargetLowering() {}
index ab704a74d70d4bcbae2610178eeb50681cc31414..a67e77f2ce692a28dcdacf6fb54e3d5e93927fc5 100644 (file)
@@ -33,7 +33,6 @@
 #include "llvm/CodeGen/SSARegMap.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Target/TargetAsmInfo.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ParameterAttributes.h"
@@ -231,13 +230,8 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM)
   setOperationAction(ISD::MEMSET          , MVT::Other, Custom);
   setOperationAction(ISD::MEMCPY          , MVT::Other, Custom);
 
-  // Use the default ISD::LOCATION expansion, and tell Legalize it's
-  // ok to use DEBUG_LOC if we have an assembler that supports it.
+  // Use the default ISD::LOCATION expansion.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
-  if (TM.getTargetAsmInfo()->hasDotLocAndDotFile())
-    setOperationAction(ISD::DEBUG_LOC, MVT::Other, Legal);
-  else
-    setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
   // FIXME - use subtarget debug flags
   if (!Subtarget->isTargetDarwin() &&
       !Subtarget->isTargetELF() &&