[PATCH] D132286: [clang][Interp] Implement function calls

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 23 00:52:43 PDT 2022


tbaeder updated this revision to Diff 454723.
tbaeder marked 3 inline comments as done.
tbaeder added a comment.

I noticed two problems:

1. Calls returning void didn't work. That needed another new opcode
2. When creating a new stackframe and running `Intepret()`... there's nothing actually stopping the interpreter after that stack frame. This triggered the `assert(VoidResult.isAbsent())` assert I added. I modified the opcode generator to return from the enclosing function if `CanReturn = 1`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132286/new/

https://reviews.llvm.org/D132286

Files:
  clang/lib/AST/Interp/ByteCodeExprGen.cpp
  clang/lib/AST/Interp/ByteCodeExprGen.h
  clang/lib/AST/Interp/EvalEmitter.cpp
  clang/lib/AST/Interp/Function.h
  clang/lib/AST/Interp/Interp.cpp
  clang/lib/AST/Interp/InterpFrame.h
  clang/lib/AST/Interp/Opcodes.td
  clang/lib/AST/Interp/PrimType.h
  clang/test/AST/Interp/functions.cpp
  clang/utils/TableGen/ClangOpcodesEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132286.454723.patch
Type: text/x-patch
Size: 10102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220823/3e04eed4/attachment-0001.bin>


More information about the cfe-commits mailing list