Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcbhmr/llvmtargetparser-wasm
🎯 LLVM's llvm::Triple and associated members extracted into a standalone C++ library
https://github.com/jcbhmr/llvmtargetparser-wasm
extracted llvm parser standalone target-triple tiny triple
Last synced: 2 days ago
JSON representation
🎯 LLVM's llvm::Triple and associated members extracted into a standalone C++ library
- Host: GitHub
- URL: https://github.com/jcbhmr/llvmtargetparser-wasm
- Owner: jcbhmr
- License: other
- Created: 2025-02-04T19:44:45.000Z (6 days ago)
- Default Branch: main
- Last Pushed: 2025-02-07T21:50:32.000Z (3 days ago)
- Last Synced: 2025-02-07T22:19:22.863Z (3 days ago)
- Topics: extracted, llvm, parser, standalone, target-triple, tiny, triple
- Language: C++
- Homepage:
- Size: 2.05 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `LLVMTargetParser` library
🎯 LLVM's `llvm::Triple` and associated members extracted into a standalone C++ library
## Installation
```sh
TODO
```## Usage
```cpp
#include
#includeint main() {
auto t = llvm::Triple("x86_64-unknown-linux-gnu");
std::cout << t.getArchName() << "\n";
return 0;
}
```## Development
This project overlays its own build system onto the existing C++ source files in the LLVM repository. Note that we aren't using Git submodules here to track the [llvm/llvm-project](https://github.com/llvm/llvm-project) repository; it's just _too large_ to be practical. Instead, we use a stripped-down pseudo-submodule in `llvm.src/` that contains only the files we need. But wait! The LLVM source code has some code generation steps that are handled by some complex CMake infrastructure. Since this particular project doesn't have any platform-specific code generation we can check in some pregenerated files from the LLVM vX.Y.Z release tarball and use those pregenerated files instead of the source versions.
TL;DR: We have `llvm.src/lib/*` which has only the source `*.cpp` files that we need to build the `libLLVMTargetParser.a` or similar library and a separate `LLVM-Linux-X64/include/*` directory that holds the released generated header files.
Use `./task.cmake generate` to generate `llvm.src/` and `LLVM-Linux-X64/` directories for the LLVM version that corresponds with the `project(... VERSION X.Y.Z)` in `CMakeLists.txt`.
Try to keep this project's versions in sync with the LLVM version that this project is extracted from. That means v19.0.0 of LLVM should correspond to v19.0.0 of this project.