[llvm] [HWASAN] Emit optimization remarks (PR #88332)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 18:06:28 PDT 2024


================
@@ -1492,23 +1493,42 @@ bool HWAddressSanitizer::instrumentStack(memtag::StackInfo &SInfo,
   return true;
 }
 
+static void emitRemark(const Function &F, OptimizationRemarkEmitter &ORE,
+                       bool Skip) {
+  if (Skip) {
+    ORE.emit([&]() {
+      return OptimizationRemark(DEBUG_TYPE, "Skip", &F)
+             << "Skipped: F=" << ore::NV("Function", &F);
+    });
+  } else {
+    ORE.emit([&]() {
+      return OptimizationRemarkMissed(DEBUG_TYPE, "Sanitize", &F)
+             << "Sanitized: F=" << ore::NV("Function", &F);
----------------
fmayer wrote:

Also, wouldn't it be better to have the same name for the Skip and non skip-Cases, and just distinguish by the Miss / Pass

https://github.com/llvm/llvm-project/pull/88332


More information about the llvm-commits mailing list