[llvm] [HWASAN] NFC? Remove DW_OP_LLVM_tag_offset from DIExpression::isImplicit (PR #79816)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 04:10:54 PST 2024


https://github.com/OCHyams created https://github.com/llvm/llvm-project/pull/79816

According to its doc-comment `isImplicit` is meant to return true if the expression is an implicit location description (describes an object or part of an object which has no location by computing the value from available program state).

There's a brief entry for `DW_OP_LLVM_tag_offset` in the LangRef and there's some info in the original commit [fb9ce100d19be130d004d03088ccd4af295f3435](https://github.com/llvm/llvm-project/commit/fb9ce100d19be130d004d03088ccd4af295f3435).

>From what I can tell it doesn't look like `DW_OP_LLVM_tag_offset` affects whether or not the location is implicit; the opcode doesn't get included in the final location description but instead is added as a attribute to the variable.

I'm not 100% confident as I'm not very familiar with `DW_OP_LLVM_tag_offset`. However, applying this change builds (with assertions enabled) an identical clang self hosted binary built with -O2 -g and hwasan, which adds confidence.

This was tripping an assertion ([code](https://github.com/llvm/llvm-project/blob/febb4c42b192ed7c88c17f91cb903a59acf20baf/llvm/lib/IR/DebugInfoMetadata.cpp#L1968)) in the latest application of the fix to #76545, #78606, where an expression containing a `DW_OP_LLVM_tag_offset` is split into a fragment (i.e., describe a part of the whole variable).





>From 061a1585a6402dfdee24ab3b6fbe456f83bcc525 Mon Sep 17 00:00:00 2001
From: OCHyams <orlando.hyamso at sony.com>
Date: Mon, 29 Jan 2024 11:44:11 +0000
Subject: [PATCH] [HWASAN] NFC? Remove DW_OP_LLVM_tag_offset from
 DIExpression::isImplicit

isImplicit is meant to return true if the expression is an implicit location
description.
---
 llvm/lib/IR/DebugInfoMetadata.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 51950fc937f0aba..28f96653d815b5d 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -1512,7 +1512,6 @@ bool DIExpression::isImplicit() const {
     default:
       break;
     case dwarf::DW_OP_stack_value:
-    case dwarf::DW_OP_LLVM_tag_offset:
       return true;
     }
   }



More information about the llvm-commits mailing list