Author: Timm Bäder Date: 2024-02-14T15:58:37+01:00 New Revision: b37bd78e411ce642a4ca9e0c2394cef8c2f389c1
URL: https://github.com/llvm/llvm-project/commit/b37bd78e411ce642a4ca9e0c2394cef8c2f389c1 DIFF: https://github.com/llvm/llvm-project/commit/b37bd78e411ce642a4ca9e0c2394cef8c2f389c1.diff LOG: [clang][Interp][NFC] Add missing special cases for implicit functions We have this special case in getSource() and getRange(), but we were missing it in getExpr() and getLocation(). Added: Modified: clang/lib/AST/Interp/InterpFrame.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp index dd05dac1703fd6..bf2cca733b66bb 100644 --- a/clang/lib/AST/Interp/InterpFrame.cpp +++ b/clang/lib/AST/Interp/InterpFrame.cpp @@ -228,10 +228,16 @@ SourceInfo InterpFrame::getSource(CodePtr PC) const { } const Expr *InterpFrame::getExpr(CodePtr PC) const { + if (Func && (!Func->hasBody() || Func->getDecl()->isImplicit()) && Caller) + return Caller->getExpr(RetPC); + return S.getExpr(Func, PC); } SourceLocation InterpFrame::getLocation(CodePtr PC) const { + if (Func && (!Func->hasBody() || Func->getDecl()->isImplicit()) && Caller) + return Caller->getLocation(RetPC); + return S.getLocation(Func, PC); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits