Saving private DebugInfo

Hi all,

Sometimes llvm::UpgradeDebugInfo drops debug info which is pretty compatible with recent llvm version ( http://stackoverflow.com/questions/27023713/missing-debug-metadata-in-llvm-after-xcode-update ) and sometimes it drops something really outdated, but acceptable for me. In both cases I want to keep it, but AFAIK there is no API for this.

I’ve tried to strip libLLVMCore from that method and it forked for me just fine, but something has changed in llvm 3.9 and now I can’t link with against hacked libLLVMCore. ( https://travis-ci.org/okutane/sanity/jobs/169662912 line 979 )

What can I do? The best solution for me would be “configuration” of how LLVMParseIRInContext deals with “outdated” debug info, but I’m open to any workarounds. :smiley:

Best regards, Dmitry.

I’ve been in need of a cl::opt to control this behavior and force preserving debug info, it would be useful for testing at least. That wouldn’t be a "first class” API though.

CC Adrian for his opinion.

any chance to get an opinion for this?

Can you submit a patch?

Thanks,