/// lexical block with an extra file.
bool DIDescriptor::isLexicalBlockFile() const {
return DbgNode && getTag() == dwarf::DW_TAG_lexical_block &&
- (DbgNode->getNumOperands() == 3);
+ (DbgNode->getNumOperands() == 4);
}
/// isLexicalBlock - Return true if the specified tag is DW_TAG_lexical_block.
if (isLValueReference() && isRValueReference())
return false;
- if (auto *F = getFunction()) {
- LLVMContext &Ctxt = F->getContext();
- for (auto &BB : *F) {
- for (auto &I : BB) {
- DebugLoc DL = I.getDebugLoc();
- if (DL.isUnknown())
- continue;
-
- MDNode *Scope = nullptr;
- MDNode *IA = nullptr;
- // walk the inlined-at scopes
- while (DL.getScopeAndInlinedAt(Scope, IA, F->getContext()), IA)
- DL = DebugLoc::getFromDILocation(IA);
- DL.getScopeAndInlinedAt(Scope, IA, Ctxt);
- assert(!IA);
- while (!DIDescriptor(Scope).isSubprogram()) {
- DILexicalBlockFile D(Scope);
- Scope = D.isLexicalBlockFile()
- ? D.getScope()
- : DebugLoc::getFromDILexicalBlock(Scope).getScope(Ctxt);
- }
- if (!DISubprogram(Scope).describes(F))
- return false;
- }
- }
- }
return DbgNode->getNumOperands() == 20;
}
/// \brief Verify that the lexical block descriptor is well formed.
bool DILexicalBlock::Verify() const {
- return isLexicalBlock() && DbgNode->getNumOperands() == 7;
+ return isLexicalBlock() && DbgNode->getNumOperands() == 6;
}
/// \brief Verify that the file-scoped lexical block descriptor is well formed.
bool DILexicalBlockFile::Verify() const {
- return isLexicalBlockFile() && DbgNode->getNumOperands() == 3;
+ return isLexicalBlockFile() && DbgNode->getNumOperands() == 4;
}
/// \brief Verify that the template type parameter descriptor is well formed.
/// copyWithNewScope - Return a copy of this location, replacing the
/// current scope with the given one.
DILocation DILocation::copyWithNewScope(LLVMContext &Ctx,
- DILexicalBlock NewScope) {
+ DILexicalBlockFile NewScope) {
SmallVector<Value *, 10> Elts;
assert(Verify());
for (unsigned I = 0; I < DbgNode->getNumOperands(); ++I) {