Help Required llc runtime error for simple MachineFunctionPass

Hello ,

I have written a very simple MachineFunction Pass that currently does nothing. It compiles fine but when I try to load it with llc it give me following error:

llc -optimize-regalloc=0 -load lib/GCRA.dylib -regalloc=gc test/fibo.bc

Pass ‘Bundle Machine CFG Edges’ is not initialized.

Verify if there is a pass dependency cycle.

What is going wrong here ?
Here is my very simple code:

//===-- GCRA.cpp - Regsiter Allocator --------------------------------===//
// This is very simple register allocator based on George and Appel.

#include “llvm/CodeGen/Passes.h”
#include “llvm/CodeGen/MachineFunction.h”
#include “llvm/CodeGen/MachineFunctionPass.h”
#include “llvm/CodeGen/MachineInstr.h”
#include “llvm/CodeGen/MachineLoopInfo.h”
#include “llvm/CodeGen/MachineFrameInfo.h”
#include “llvm/CodeGen/MachineRegisterInfo.h”
#include “llvm/CodeGen/RegAllocRegistry.h”
#include “llvm/Target/TargetInstrInfo.h”
#include “llvm/Target/TargetMachine.h”
#define DEBUG_TYPE “gcra”
#include “llvm/Support/Debug.h”
#include “llvm/Support/Compiler.h”
#include “llvm/ADT/Statistic.h”
#include “llvm/CodeGen/VirtRegMap.h”
#include “llvm/PassAnalysisSupport.h”

using namespace llvm;

namespace {
class GCRA : public MachineFunctionPass {

static char id; // Pass Identification

GCRA() : MachineFunctionPass(id) {


bool runOnMachineFunction(MachineFunction &MFn) {
return false;

void getAnalysisUsage(AnalysisUsage &AU) const {


char GCRA::id = 0;

namespace llvm {
FunctionPass *createGCRA() { return new GCRA(); }

static RegisterRegAlloc register_gcra(“gc”,
“graph-coloring register allocator”,

Please help!