Fix for rev.221375

This commit is contained in:
Vsevolod Livinskiy
2014-11-06 17:06:37 +03:00
parent 9e184e65cf
commit fcc1090595

View File

@@ -168,7 +168,11 @@ lStripUnusedDebugInfo(llvm::Module *module) {
// loop over the compile units that contributed to the final module // loop over the compile units that contributed to the final module
if (llvm::NamedMDNode *cuNodes = module->getNamedMetadata("llvm.dbg.cu")) { if (llvm::NamedMDNode *cuNodes = module->getNamedMetadata("llvm.dbg.cu")) {
for (unsigned i = 0, ie = cuNodes->getNumOperands(); i != ie; ++i) { for (unsigned i = 0, ie = cuNodes->getNumOperands(); i != ie; ++i) {
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
llvm::MDNode *cuNode = cuNodes->getOperand(i); llvm::MDNode *cuNode = cuNodes->getOperand(i);
#else // LLVM 3.6+
llvm::MDNode *cuNode = llvm::cast<llvm::MDNode>(cuNodes->getOperand(i));
#endif
llvm::DICompileUnit cu(cuNode); llvm::DICompileUnit cu(cuNode);
llvm::DIArray subprograms = cu.getSubprograms(); llvm::DIArray subprograms = cu.getSubprograms();
std::vector<llvm::Value *> usedSubprograms; std::vector<llvm::Value *> usedSubprograms;