@@ -207,31 +207,40 @@ Pointer InterpFrame::getParamPointer(unsigned Off) {
207
207
return Pointer (B);
208
208
}
209
209
210
+ static bool funcHasUsableBody (const Function *F) {
211
+ assert (F);
212
+
213
+ if (F->isConstructor () || F->isDestructor ())
214
+ return true ;
215
+
216
+ return !F->getDecl ()->isImplicit ();
217
+ }
218
+
210
219
SourceInfo InterpFrame::getSource (CodePtr PC) const {
211
220
// Implicitly created functions don't have any code we could point at,
212
221
// so return the call site.
213
- if (Func && (!Func-> hasBody () || Func-> getDecl ()-> isImplicit () ) && Caller)
222
+ if (Func && ! funcHasUsableBody ( Func) && Caller)
214
223
return Caller->getSource (RetPC);
215
224
216
225
return S.getSource (Func, PC);
217
226
}
218
227
219
228
const Expr *InterpFrame::getExpr (CodePtr PC) const {
220
- if (Func && (!Func-> hasBody () || Func-> getDecl ()-> isImplicit () ) && Caller)
221
- return Caller->getExpr (RetPC );
229
+ if (Func && ! funcHasUsableBody ( Func) && Caller)
230
+ return Caller->getExpr (PC );
222
231
223
232
return S.getExpr (Func, PC);
224
233
}
225
234
226
235
SourceLocation InterpFrame::getLocation (CodePtr PC) const {
227
- if (Func && (!Func-> hasBody () || Func-> getDecl ()-> isImplicit () ) && Caller)
236
+ if (Func && ! funcHasUsableBody ( Func) && Caller)
228
237
return Caller->getLocation (RetPC);
229
238
230
239
return S.getLocation (Func, PC);
231
240
}
232
241
233
242
SourceRange InterpFrame::getRange (CodePtr PC) const {
234
- if (Func && (!Func-> hasBody () || Func-> getDecl ()-> isImplicit () ) && Caller)
243
+ if (Func && ! funcHasUsableBody ( Func) && Caller)
235
244
return Caller->getRange (RetPC);
236
245
237
246
return S.getRange (Func, PC);
0 commit comments