Author: Timm Bäder
Date: 2024-09-07T10:56:18+02:00
New Revision: 7d4afba831bcf9b3e50ee7b6a3fbc9c0a7c61597

URL: 
https://github.com/llvm/llvm-project/commit/7d4afba831bcf9b3e50ee7b6a3fbc9c0a7c61597
DIFF: 
https://github.com/llvm/llvm-project/commit/7d4afba831bcf9b3e50ee7b6a3fbc9c0a7c61597.diff

LOG: [clang][bytecode][NFC] Fix Function::getName() for non-decl functions

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Function.h

Removed: 
    


################################################################################
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 "<<expr>>";
 
-    return Source.get<const FunctionDecl *>()->getQualifiedNameAsString();
+    return getDecl()->getQualifiedNameAsString();
   }
 
   /// Returns a parameter descriptor.


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to