[all-commits] [llvm/llvm-project] e032d7: [clang-repl] Improve flags responsible for generat...

Anutosh Bhat via All-commits all-commits at lists.llvm.org
Mon Nov 25 00:33:46 PST 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: e032d7ad80f8d185626b39751f672932f92dc033
      https://github.com/llvm/llvm-project/commit/e032d7ad80f8d185626b39751f672932f92dc033
  Author: Anutosh Bhat <andersonbhat491 at gmail.com>
  Date:   2024-11-25 (Mon, 25 Nov 2024)

  Changed paths:
    M clang/lib/Interpreter/IncrementalExecutor.h
    M clang/lib/Interpreter/Interpreter.cpp
    M clang/lib/Interpreter/Wasm.cpp
    M clang/lib/Interpreter/Wasm.h

  Log Message:
  -----------
  [clang-repl] Improve flags responsible for generating shared wasm binaries (#116735)

There are a couple changes in this PR that help getting clang-repl to
run in the browser. Using a jupyterlite instance for the example pasted
below

1) Updating flags responsible for generating shared wasm binaries that
need to be dynamically loaded Most Importantly as can be seen in the
changes `shared` and `allow-undefined` are crucial.

![image](https://github.com/user-attachments/assets/1183fd44-8951-496a-899a-e4af39a48447)

2) While exiting we encounter this.

![image](https://github.com/user-attachments/assets/9487a3f4-7200-471d-ba88-09e98ccbc47a)

Now as can be seen here

https://github.com/llvm/llvm-project/blob/cd418030de7ae75750bc4e48d1238baf03c675e5/clang/lib/Interpreter/Interpreter.cpp#L421-L430

We call cleanUP in the destructor. Now cleanUP through
IncrementalExecutor tries to deinitialize the JIT which wasn't even
intialized as runCtors in wasm.cpp is a no-op

https://github.com/llvm/llvm-project/blob/cd418030de7ae75750bc4e48d1238baf03c675e5/clang/lib/Interpreter/IncrementalExecutor.cpp#L94-L101

https://github.com/llvm/llvm-project/blob/cd418030de7ae75750bc4e48d1238baf03c675e5/clang/lib/Interpreter/Wasm.cpp#L107-L109
(cherry picked from commit 752dbd6112affa418e33910ac08bf9921f9c270b)



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