C
compiler-development
Expertise in compiler development using LLVM infrastructure including frontend design, IR generation, optimization passes, and code generation. Use this skill when building custom programming languages, implementing DSL compilers, or working on compiler internals.
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Expertise in compiler development using LLVM infrastructure including frontend design, IR generation, optimization passes, and code generation. Use this skill when building custom programming languages, implementing DSL compilers, or working on compiler internals.
How to use
- Zainstaluj umiejętność w swoim środowisku Claude, wskazując ścieżkę do repozytorium gmh5225/awesome-llvm-security w katalogu .claude/skills/compiler-development. 2. Gdy zaczniesz projekt kompilatorowy, aktywuj tę umiejętność, aby uzyskać dostęp do wiedzy o architekturze kompilatorów i wzorcach LLVM. 3. Dla nowego języka programowania lub DSL zacznij od frontendu: zdefiniuj tokeny (TokenKind), zaimplementuj leksykalną analizę tekstu źródłowego oraz wybierz strategię parsowania (recursive descent dla prostoty, operator precedence dla wyrażeń, LALR/LR dla złożonych gramatyk). 4. Zaprojektuj abstrakcyjne drzewo składni (AST) dziedziczące z klasy bazowej Expr, implementując metodę codegen() do generowania kodu LLVM IR dla każdego węzła. 5. Skonfiguruj kontekst LLVM (LLVMContext) i moduł, a następnie przekształć AST w LLVM IR za pomocą dostępnych operacji (CreateFAdd, CreateFSub, CreateFMul itp.). 6. Dodaj pasy optymalizacyjne w fazie middle-end, a następnie wygeneruj kod docelowy dla wybranej architektury procesora za pomocą backendu LLVM.