|
@@ -43,6 +43,7 @@
|
|
|
#include <memory>
|
|
|
#include "dxc/HLSL/DxilGenerationPass.h" // HLSL Change
|
|
|
#include "dxc/HLSL/HLMatrixLowerPass.h" // HLSL Change
|
|
|
+#include "dxc/Support/Global.h" // HLSL Change
|
|
|
|
|
|
using namespace clang;
|
|
|
using namespace llvm;
|
|
@@ -762,7 +763,15 @@ void clang::EmitBackendOutput(DiagnosticsEngine &Diags,
|
|
|
raw_pwrite_stream *OS) {
|
|
|
EmitAssemblyHelper AsmHelper(Diags, CGOpts, TOpts, LOpts, M);
|
|
|
|
|
|
- AsmHelper.EmitAssembly(Action, OS);
|
|
|
+
|
|
|
+ try { // HLSL Change Starts
|
|
|
+ // Catch any fatal errors during optimization passes here
|
|
|
+ // so that future passes can be skipped.
|
|
|
+ AsmHelper.EmitAssembly(Action, OS);
|
|
|
+ } catch (const ::hlsl::Exception &hlslException) {
|
|
|
+ Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0\n"))
|
|
|
+ << StringRef(hlslException.what());
|
|
|
+ } // HLSL Change Ends
|
|
|
|
|
|
// If an optional clang TargetInfo description string was passed in, use it to
|
|
|
// verify the LLVM TargetMachine's DataLayout.
|