diff options
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 14 | ||||
| -rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 15 | ||||
| -rw-r--r-- | llvm/lib/IR/Verifier.cpp | 10 |
5 files changed, 14 insertions, 36 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index a2eb545f8b1..d314727c4ea 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -1745,7 +1745,6 @@ static void writeMDLocalVariable(raw_ostream &Out, const MDLocalVariable *N, Printer.printInt("line", N->getLine()); Printer.printMetadata("type", N->getRawType()); Printer.printDIFlags("flags", N->getFlags()); - Printer.printMetadata("inlinedAt", N->getRawInlinedAt()); Out << ")"; } diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index ca7a4f4801b..3e34572c044 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -35,16 +35,6 @@ using namespace llvm::dwarf; DIScopeRef DIScope::getRef() const { return MDScopeRef::get(get()); } -DIVariable llvm::createInlinedVariable(MDNode *DV, MDNode *InlinedScope, - LLVMContext &VMContext) { - return cast<MDLocalVariable>(DV) - ->withInline(cast_or_null<MDLocation>(InlinedScope)); -} - -DIVariable llvm::cleanseInlinedVariable(MDNode *DV, LLVMContext &VMContext) { - return cast<MDLocalVariable>(DV)->withoutInline(); -} - DISubprogram llvm::getDISubprogram(const MDNode *Scope) { if (auto *LocalScope = dyn_cast_or_null<MDLocalScope>(Scope)) return LocalScope->getSubprogram(); diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index 1ad09dafa4e..f6f2ff2d20c 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -450,10 +450,12 @@ MDGlobalVariable::getImpl(LLVMContext &Context, Metadata *Scope, MDString *Name, Ops); } -MDLocalVariable *MDLocalVariable::getImpl( - LLVMContext &Context, unsigned Tag, Metadata *Scope, MDString *Name, - Metadata *File, unsigned Line, Metadata *Type, unsigned Arg, unsigned Flags, - Metadata *InlinedAt, StorageType Storage, bool ShouldCreate) { +MDLocalVariable *MDLocalVariable::getImpl(LLVMContext &Context, unsigned Tag, + Metadata *Scope, MDString *Name, + Metadata *File, unsigned Line, + Metadata *Type, unsigned Arg, + unsigned Flags, StorageType Storage, + bool ShouldCreate) { // Truncate Arg to 8 bits. // // FIXME: This is gross (and should be changed to an assert or removed), but @@ -463,8 +465,8 @@ MDLocalVariable *MDLocalVariable::getImpl( assert(Scope && "Expected scope"); assert(isCanonical(Name) && "Expected canonical MDString"); DEFINE_GETIMPL_LOOKUP(MDLocalVariable, (Tag, Scope, getString(Name), File, - Line, Type, Arg, Flags, InlinedAt)); - Metadata *Ops[] = {Scope, Name, File, Type, InlinedAt}; + Line, Type, Arg, Flags)); + Metadata *Ops[] = {Scope, Name, File, Type}; DEFINE_GETIMPL_STORE(MDLocalVariable, (Tag, Line, Arg, Flags), Ops); } diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index 6f9a3e1f639..c096a831b20 100644 --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -736,29 +736,24 @@ template <> struct MDNodeKeyImpl<MDLocalVariable> { Metadata *Type; unsigned Arg; unsigned Flags; - Metadata *InlinedAt; MDNodeKeyImpl(unsigned Tag, Metadata *Scope, StringRef Name, Metadata *File, - unsigned Line, Metadata *Type, unsigned Arg, unsigned Flags, - Metadata *InlinedAt) + unsigned Line, Metadata *Type, unsigned Arg, unsigned Flags) : Tag(Tag), Scope(Scope), Name(Name), File(File), Line(Line), Type(Type), - Arg(Arg), Flags(Flags), InlinedAt(InlinedAt) {} + Arg(Arg), Flags(Flags) {} MDNodeKeyImpl(const MDLocalVariable *N) : Tag(N->getTag()), Scope(N->getRawScope()), Name(N->getName()), File(N->getRawFile()), Line(N->getLine()), Type(N->getRawType()), - Arg(N->getArg()), Flags(N->getFlags()), - InlinedAt(N->getRawInlinedAt()) {} + Arg(N->getArg()), Flags(N->getFlags()) {} bool isKeyOf(const MDLocalVariable *RHS) const { return Tag == RHS->getTag() && Scope == RHS->getRawScope() && Name == RHS->getName() && File == RHS->getRawFile() && Line == RHS->getLine() && Type == RHS->getRawType() && - Arg == RHS->getArg() && Flags == RHS->getFlags() && - InlinedAt == RHS->getRawInlinedAt(); + Arg == RHS->getArg() && Flags == RHS->getFlags(); } unsigned getHashValue() const { - return hash_combine(Tag, Scope, Name, File, Line, Type, Arg, Flags, - InlinedAt); + return hash_combine(Tag, Scope, Name, File, Line, Type, Arg, Flags); } }; diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 3df885ac8f9..fba78e92a09 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -1075,9 +1075,6 @@ void Verifier::visitMDLocalVariable(const MDLocalVariable &N) { "invalid tag", &N); Assert(N.getRawScope() && isa<MDLocalScope>(N.getRawScope()), "local variable requires a valid scope", &N, N.getRawScope()); - if (auto *IA = N.getRawInlinedAt()) - Assert(isa<MDLocation>(IA), "local variable requires a valid scope", &N, - IA); } void Verifier::visitMDExpression(const MDExpression &N) { @@ -3401,17 +3398,12 @@ void Verifier::visitDbgIntrinsic(StringRef Kind, DbgIntrinsicTy &DII) { BasicBlock *BB = DII.getParent(); Function *F = BB ? BB->getParent() : nullptr; - // The inlined-at attachments for variables and !dbg attachments must agree. + // The scopes for variables and !dbg attachments must agree. MDLocalVariable *Var = DII.getVariable(); - MDLocation *VarIA = Var->getInlinedAt(); MDLocation *Loc = DII.getDebugLoc(); Assert(Loc, "llvm.dbg." + Kind + " intrinsic requires a !dbg attachment", &DII, BB, F); - MDLocation *LocIA = Loc->getInlinedAt(); - Assert(VarIA == LocIA, "mismatched variable and !dbg inlined-at", &DII, BB, F, - Var, VarIA, Loc, LocIA); - MDSubprogram *VarSP = getSubprogram(Var->getRawScope()); MDSubprogram *LocSP = getSubprogram(Loc->getRawScope()); if (!VarSP || !LocSP) |

