LLVM

LLVM Documentation

Comprehensive guides, tutorials, and references for LLVM tools and infrastructure

Get Started

Documentation Resources

Getting Started

Step-by-step guides for installing LLVM tools, setting up development environments.

View Getting Started Guide →

API References

Detailed documentation for LLVM libraries, command-line tools, and programmatic interfaces.

View API Reference →

Featured Tutorials

WebAssembly Compilation

Learn to compile C/C++ to WebAssembly using LLVM's modern toolchain.

Read Tutorial

Custom Pass Development

Create custom LLVM optimization passes for code analysis and transformation.

Read Tutorial

Clang Plugins

Extend Clang with custom static analysis tools and code transformations.

Read Tutorial

Example: Optimization Pass

// llvm/docs/optimization-pass.cpp
#include "llvm/Passes/Pass.h"
#include "llvm/IR/Function.h"

namespace {
  struct MyOptPass : public llvm::FunctionPass {
    static char ID;
    MyOptPass() : FunctionPass(id) {}

    bool runOnFunction(llvm::Function &F) override {
      // Implementation here
      return true;
    }
  };
}

char MyOptPass::id = 0;
static llvm::RegisterPass X("myopt", "Custom Optimization Pass");

Want to Contribute?

Improve our documentation or add new guides to help the LLVM community.

Contribute to Documentation