[04/11] ir: Make odr_is_relevant support support artifacts with no TU set yet

Message ID 20240814125649.47119-4-dodji@redhat.com
State New
Headers
Series [01/11] Use smart pointers for variables exported from the ABI corpus |

Commit Message

Dodji Seketeli Aug. 14, 2024, 12:56 p.m. UTC
  From: Dodji Seketeli <dodji@redhat.com>

	* src/abg-ir.cc (odr_is_relevant): Consider that an artifact with
	no associated TU is not relevant for ODR considerations.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-ir.cc | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 7d8de813..9dcdc1c7 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -10070,6 +10070,9 @@  debug_comp_stack(const environment& env)
 bool
 odr_is_relevant(const type_or_decl_base& artifact)
 {
+  if (!artifact.get_translation_unit())
+    return false;
+
   translation_unit::language l =
     artifact.get_translation_unit()->get_language();