Skip to content

Commit 7d4afba

Browse files
committed
[clang][bytecode][NFC] Fix Function::getName() for non-decl functions
1 parent 610b853 commit 7d4afba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/ByteCode/Function.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ class Function final {
103103
/// Returns the name of the function decl this code
104104
/// was generated for.
105105
const std::string getName() const {
106-
if (!Source)
106+
if (!Source || !getDecl())
107107
return "<<expr>>";
108108

109-
return Source.get<const FunctionDecl *>()->getQualifiedNameAsString();
109+
return getDecl()->getQualifiedNameAsString();
110110
}
111111

112112
/// Returns a parameter descriptor.

0 commit comments

Comments
 (0)