[PATCH] D131888: [Clang][Interp] Add some basic functionality to the experimental new constant interpreter

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 06:33:59 PDT 2022


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

Hi,

I wanted to maybe work on the new experimental constant interpreter in clang. I took last week to get to know the code a little and implement some basic functionality.

New in this patch are:

- Simple function calls
- array initializers and subscript expressions
- pointer reference and dereference
- local and global variables

Some tests for the functionality is in `test/AST/Interp/interp.cpp`.

As far as I know the interpreter has been abandoned quite some time ago, so I was just looking for some basic feedback about whether this is worth it to pursue. If the feedback is positive, I will continue working on it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131888

Files:
  clang/lib/AST/Interp/Boolean.h
  clang/lib/AST/Interp/ByteCodeExprGen.cpp
  clang/lib/AST/Interp/ByteCodeExprGen.h
  clang/lib/AST/Interp/ByteCodeStmtGen.cpp
  clang/lib/AST/Interp/ByteCodeStmtGen.h
  clang/lib/AST/Interp/Context.h
  clang/lib/AST/Interp/Descriptor.h
  clang/lib/AST/Interp/Disasm.cpp
  clang/lib/AST/Interp/EvalEmitter.cpp
  clang/lib/AST/Interp/Function.cpp
  clang/lib/AST/Interp/Function.h
  clang/lib/AST/Interp/Integral.h
  clang/lib/AST/Interp/Interp.cpp
  clang/lib/AST/Interp/Interp.h
  clang/lib/AST/Interp/InterpBlock.h
  clang/lib/AST/Interp/InterpFrame.cpp
  clang/lib/AST/Interp/InterpStack.h
  clang/lib/AST/Interp/InterpState.h
  clang/lib/AST/Interp/Opcodes.td
  clang/lib/AST/Interp/Pointer.h
  clang/lib/AST/Interp/PrimType.h
  clang/lib/AST/Interp/Source.h
  clang/test/AST/Interp/interp.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131888.452645.patch
Type: text/x-patch
Size: 34788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220815/de972750/attachment-0001.bin>


More information about the cfe-commits mailing list