mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable
Remove 'inlinedAt:' from MDLocalVariable. Besides saving some memory (variables with it seem to be single largest `Metadata` contributer to memory usage right now in -g -flto builds), this stops optimization and backend passes from having to change local variables. The 'inlinedAt:' field was used by the backend in two ways: 1. To tell the backend whether and into what a variable was inlined. 2. To create a unique id for each inlined variable. Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg` attachment, and change the DWARF backend to use a typedef called `InlinedVariable` which is `std::pair<MDLocalVariable*, MDLocation*>`. This `DebugLoc` is already passed reliably through the backend (as verified by r234021). This commit removes the check from r234021, but I added a new check (that will survive) in r235048, and changed the `DIBuilder` API in r235041 to require a `!dbg` attachment whose 'scope:` is in the same `MDSubprogram` as the variable's. If this breaks your out-of-tree testcases, perhaps the script I used (mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778 in a moment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user