[clang] b37bd78 - [clang][Interp][NFC] Add missing special cases for implicit functions
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 14 07:00:58 PST 2024
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);
}
More information about the cfe-commits
mailing list