About the MachinePassRegistry

Hi all,

The "Creating new registries" part on the "Writing An LLVM Pass" page seems unclear.

I copied "llvm/CodeGen/RegAllocRegistry.h" to my project directory, modify the class name and the FunctionPassCtor type, and add code in the document to my "machinepass.cpp" file.

But the llc -help doesn't show anything about the registry.
Which part is responsible for making the part ofcl::opt code?

Can anyone show me a complete sample of building a runnable machine function pass?