From 7d4afba831bcf9b3e50ee7b6a3fbc9c0a7c61597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 4 Sep 2024 14:26:43 +0200 Subject: [PATCH] [clang][bytecode][NFC] Fix Function::getName() for non-decl functions --- clang/lib/AST/ByteCode/Function.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/AST/ByteCode/Function.h b/clang/lib/AST/ByteCode/Function.h index b21fa8497130ea..640bfa65644f0f 100644 --- a/clang/lib/AST/ByteCode/Function.h +++ b/clang/lib/AST/ByteCode/Function.h @@ -103,10 +103,10 @@ class Function final { /// Returns the name of the function decl this code /// was generated for. const std::string getName() const { - if (!Source) + if (!Source || !getDecl()) return "<>"; - return Source.get()->getQualifiedNameAsString(); + return getDecl()->getQualifiedNameAsString(); } /// Returns a parameter descriptor.