[PATCH] D136936: [clang][Interp] Handle undefined functions better

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 28 03:07:50 PDT 2022


tbaeder created this revision.
tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Make sure we add body-less functions to our program as well, and add the actual body later. We then need to compile functions again later once we have the definition with a body.

We do  a bunch of work in `ByteCodeEmitter::compileFunc()` to prepare the values passed to `Program::createFunction()` even if we don't need them now, that's a possible optimization for a later commit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136936

Files:
  clang/lib/AST/Interp/ByteCodeEmitter.cpp
  clang/lib/AST/Interp/ByteCodeExprGen.cpp
  clang/lib/AST/Interp/Context.cpp
  clang/lib/AST/Interp/Interp.cpp
  clang/lib/AST/Interp/Interp.h
  clang/lib/AST/Interp/Program.cpp
  clang/lib/AST/Interp/Program.h
  clang/test/AST/Interp/functions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136936.471470.patch
Type: text/x-patch
Size: 6468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221028/e4e87ac9/attachment.bin>


More information about the cfe-commits mailing list