diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2024-12-12 09:01:48 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-11 16:01:48 -0800 |
commit | ea632e1b34e1878b977f8adc406a89e91aa98b7e (patch) | |
tree | a6e50bd5fe024ea74d97be89c9180f5e4afa0a94 /llvm/lib/CodeGen/XRayInstrumentation.cpp | |
parent | dd647e3e608ed0b2bac7c588d5859b80ef4a5976 (diff) | |
download | llvm-ea632e1b34e1878b977f8adc406a89e91aa98b7e.zip llvm-ea632e1b34e1878b977f8adc406a89e91aa98b7e.tar.gz llvm-ea632e1b34e1878b977f8adc406a89e91aa98b7e.tar.bz2 |
Reapply "DiagnosticInfo: Clean up usage of DiagnosticInfoInlineAsm" (#119575) (#119634)
This reverts commit 40986feda8b1437ed475b144d5b9a208b008782a.
Reapply with fix to prevent temporary Twine from going out of scope.
Diffstat (limited to 'llvm/lib/CodeGen/XRayInstrumentation.cpp')
-rw-r--r-- | llvm/lib/CodeGen/XRayInstrumentation.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/XRayInstrumentation.cpp b/llvm/lib/CodeGen/XRayInstrumentation.cpp index 8af16fa..06a85fb 100644 --- a/llvm/lib/CodeGen/XRayInstrumentation.cpp +++ b/llvm/lib/CodeGen/XRayInstrumentation.cpp @@ -24,6 +24,7 @@ #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/IR/Attributes.h" +#include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/Function.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" @@ -211,8 +212,12 @@ bool XRayInstrumentation::runOnMachineFunction(MachineFunction &MF) { auto &FirstMI = *FirstMBB.begin(); if (!MF.getSubtarget().isXRaySupported()) { - FirstMI.emitError("An attempt to perform XRay instrumentation for an" - " unsupported target."); + + const Function &Fn = FirstMBB.getParent()->getFunction(); + Fn.getContext().diagnose(DiagnosticInfoUnsupported( + Fn, "An attempt to perform XRay instrumentation for an" + " unsupported target.")); + return false; } |