Skip to content

Commit

Permalink
[clang][bytecode][NFC] Fix Function::getName() for non-decl functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Sep 7, 2024
1 parent 610b853 commit 7d4afba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/lib/AST/ByteCode/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7d4afba

Please sign in to comment.