Skip to content

Commit

Permalink
Add support for Atomic functions to NameGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
Maqrkk committed Dec 13, 2023
1 parent 8200c56 commit 6292a94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions llvm/include/llvm/Cheerp/NameGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ class NameGenerator
HANDLE_VAARG,
EXCEPTION,
FETCHBUFFER,
ATOMICLOAD,
ATOMICSTORE,
ATOMICADD,
ATOMICSUB,
ATOMICAND,
ATOMICOR,
ATOMICXOR,
ATOMICXCHG,
ATOMICCMPXCHG,
MEMORY,
HEAP8,
HEAP16,
Expand Down
9 changes: 9 additions & 0 deletions llvm/lib/CheerpWriter/NameGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,15 @@ void NameGenerator::generateReadableNames(const Module& M, const GlobalDepsAnaly
builtins[EXCEPTION] = "$except";
builtins[FETCHBUFFER] = "fetchBuffer";
builtins[STACKPTR] = "__stackPtr";
builtins[ATOMICLOAD] = "__atomicload";
builtins[ATOMICSTORE] = "__atomicstore";
builtins[ATOMICADD] = "__atomicadd";
builtins[ATOMICSUB] = "__atomicsub";
builtins[ATOMICAND] = "__atomicand";
builtins[ATOMICOR] = "__atomicor";
builtins[ATOMICXOR] = "__atomicxor";
builtins[ATOMICXCHG] = "__atomicexchange";
builtins[ATOMICCMPXCHG] = "__atomiccompareExchange";
builtins[HEAP8] = "HEAP8";
builtins[HEAP16] = "HEAP16";
builtins[HEAP32] = "HEAP32";
Expand Down

0 comments on commit 6292a94

Please sign in to comment.