[all-commits] [llvm/llvm-project] fa133d: [clang][Interp] Implement dynamic memory allocatio...

Timm Baeder via All-commits all-commits at lists.llvm.org
Sun Jul 14 10:58:39 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa133d3151b5e428b1c5819d29b0ad28a90882a2
      https://github.com/llvm/llvm-project/commit/fa133d3151b5e428b1c5819d29b0ad28a90882a2
  Author: Timm Baeder <tbaeder at redhat.com>
  Date:   2024-07-14 (Sun, 14 Jul 2024)

  Changed paths:
    M clang/lib/AST/CMakeLists.txt
    M clang/lib/AST/Interp/Compiler.cpp
    M clang/lib/AST/Interp/Compiler.h
    A clang/lib/AST/Interp/DynamicAllocator.cpp
    A clang/lib/AST/Interp/DynamicAllocator.h
    M clang/lib/AST/Interp/EvalEmitter.cpp
    M clang/lib/AST/Interp/EvaluationResult.cpp
    M clang/lib/AST/Interp/EvaluationResult.h
    M clang/lib/AST/Interp/Interp.cpp
    M clang/lib/AST/Interp/Interp.h
    M clang/lib/AST/Interp/InterpBlock.h
    M clang/lib/AST/Interp/InterpState.cpp
    M clang/lib/AST/Interp/InterpState.h
    M clang/lib/AST/Interp/Opcodes.td
    M clang/lib/AST/Interp/Pointer.h
    A clang/test/AST/Interp/new-delete.cpp
    M clang/test/Rewriter/rewrite-modern-catch.m
    M clang/test/SemaCXX/delete.cpp
    M clang/test/SemaCXX/new-delete.cpp

  Log Message:
  -----------
  [clang][Interp] Implement dynamic memory allocation handling (#70306)

Implement handling for new/delete/new[]/delete[] expressions via a new
`DynamicAllocator` class.

This introduces four new opcodes:
 - `Alloc` - Allocates one element (`new int(14)`)
- `AllocN` - Allocates N elements of the given primitive (`new
int[100]`)
- `AllocCN` - Allocates N elements of the given (composite) descriptor
(`new S[100]`)
 - `Free` - de-allocates memory allocates using any of the above.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list