const LLVMContext &ctx = MF->getFunction()->getContext();
DIScope Scope(curLoc.getScope(ctx));
- if (!Scope.isScope())
+ if (!Scope.Verify())
return;
StringRef fileName(Scope.getFilename());
DIArray SPs = CU.getSubprograms();
for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i) {
DISubprogram SP(SPs.getElement(i));
- assert(SP.isSubprogram());
+ if (!SP.Verify()) continue;
Function *F = SP.getFunction();
if (!F) continue;
SmallVector<std::pair<GlobalVariable *, MDNode *>, 8> CountersBySP;
for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i) {
DISubprogram SP(SPs.getElement(i));
- assert(SP.isSubprogram());
+ if (!SP.Verify()) continue;
Function *F = SP.getFunction();
if (!F) continue;
if (!Result) Result = true;
bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
StoreInst *SI, DIBuilder &Builder) {
DIVariable DIVar(DDI->getVariable());
- if (!DIVar.isVariable())
+ if (!DIVar.Verify())
return false;
if (LdStHasDebugValue(DIVar, SI))
bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
LoadInst *LI, DIBuilder &Builder) {
DIVariable DIVar(DDI->getVariable());
- if (!DIVar.isVariable())
+ if (!DIVar.Verify())
return false;
if (LdStHasDebugValue(DIVar, LI))
if (!DDI)
return false;
DIVariable DIVar(DDI->getVariable());
- if (!DIVar.isVariable())
+ if (!DIVar.Verify())
return false;
// Create a copy of the original DIDescriptor for user variable, appending
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
std::string Name;
DISubprogram SP(NMD->getOperand(i));
- assert(SP.isSubprogram());
- getContextName(SP.getContext(), Name);
+ if (SP.Verify())
+ getContextName(SP.getContext(), Name);
Name = Name + SP.getDisplayName().str();
if (!Name.empty() && Processed.insert(Name)) {
Out << Name << "\n";