DebugInfo: seg fault


I wanted to print the contents of a DICompileUnit object but encountered a segmentation fault after invoking dump()/print method. Here is the code snippet

unsigned DW_LANG_XXX = 0x8001;
llvm::StringRef filename(“l8.cpp”);
llvm::StringRef dir("/home/cfiles");
const char* producer = “Group”;
llvm::DIFactory DICreator(*theModule);
llvm::DICompileUnit diCompUnit = DICreator.CreateCompileUnit
(DW_LANG_XXX, filename, dir, llvm::StringRef(producer), true);

diCompUnit.dump(); // segmentation fault

Is anything wrong with my code?

Thank you,

Best regards,