[PATCH] D102995: errorUnsupported should be non-fatal

MJ via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 23 19:08:02 PDT 2021


majiang31312 created this revision.
majiang31312 added reviewers: rnk, craig.topper.
Herald added subscribers: pengfei, hiraditya.
majiang31312 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

DiagnosticInfoUnsupported use DS_Error as the default severity, but we want errorUnsupported to be non-fatal.

So we should pass DS_Warning explicitly in errorUnsupported.
============================================================

before fix, the following code could not be built with ‘clang -mno-sse’

double test() {return 0.0;}
int main()
{

  double a = test();
  return 0;

}


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102995

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- llvm/lib/Target/X86/X86ISelLowering.cpp
+++ llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -96,8 +96,8 @@
 static void errorUnsupported(SelectionDAG &DAG, const SDLoc &dl,
                              const char *Msg) {
   MachineFunction &MF = DAG.getMachineFunction();
-  DAG.getContext()->diagnose(
-      DiagnosticInfoUnsupported(MF.getFunction(), Msg, dl.getDebugLoc()));
+  DAG.getContext()->diagnose(DiagnosticInfoUnsupported(
+      MF.getFunction(), Msg, dl.getDebugLoc(), DS_Warning));
 }
 
 X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102995.347284.patch
Type: text/x-patch
Size: 684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210524/ed74ff6f/attachment.bin>


More information about the llvm-commits mailing list