[all-commits] [llvm/llvm-project] 10b5fe: [JITLink][ORC] Add LinkGraph::allocateCString method.

lhames via All-commits all-commits at lists.llvm.org
Sat Feb 11 12:30:45 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 10b5fec25638f7cca34d071db2a1d2afcab09a6d
      https://github.com/llvm/llvm-project/commit/10b5fec25638f7cca34d071db2a1d2afcab09a6d
  Author: Lang Hames <lhames at gmail.com>
  Date:   2023-02-11 (Sat, 11 Feb 2023)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
    M llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
    M llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
    M llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
    M llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
    M llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
    M llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp

  Log Message:
  -----------
  [JITLink][ORC] Add LinkGraph::allocateCString method.

Renames the existing allocateString method to allocateContent and adds a pair of
allocateCString methods.

The previous allocateString method did not include a null-terminator. It behaved
the same as allocateContent except with a Twine input, rather than an
ArrayRef<char>. Renaming allocateString to allocateBuffer (overloading the
existing method) makes this clearer.

The new allocateCString methods allocate the given content plus a
null-terminator character, and return a buffer covering both the string and
null-terminator. This makes them suitable for creating c-string content for
jitlink::Blocks.

Existing users of the old allocateString method have been updated to use the
new allocateContent overload.




More information about the All-commits mailing list