Related to LLVM MemoryDependenceAnalysis

I am getting error after executing these lines

MemoryDependenceAnalysis mda;

MemDepResult mdr = mda.getDependency(inst);

if (mdr.isDef())
{
Instruction *dep = mdr.getInst ();
if (isa (inst))
{
if (isa (dep))
{
outs()<<“READ AFTER WRITE”;

}
}
if (isa (inst))
{
if (isa (dep))
{
outs()<<“WRITE AFTER READ”;

}
if (isa (dep))
{

outs()<<“WRITE AFTER WRITE”;

}
}
}

—ERROR—

0 opt 0x090a9dbb llvm::sys::PrintStackTrace(_IO_FILE*) + 43
Stack dump:
0. Program arguments: opt -load …/…/…/Release+Asserts/lib/shams.so -shams

  1. Running pass ‘Function Pass Manager’ on module ‘’.
  2. Running pass ‘Function Argument Count Pass’ on function ‘@swap
    Segmentation fault (core dumped)

Please help.

Thanks