mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Debug Info: Assign unique names to anonymous variables and arguments.
rdar://problem/18139663
This commit is contained in:
@@ -324,9 +324,17 @@ struct ArgumentInitVisitor :
|
||||
++ArgNo;
|
||||
auto PD = P->getDecl();
|
||||
if (!PD->hasName()) {
|
||||
ManagedValue argrv = makeArgument(P->getType(), &*f.begin(), PD);
|
||||
// Emit debug information for the argument.
|
||||
SILLocation loc(PD);
|
||||
loc.markAsPrologue();
|
||||
if (argrv.getType().isAddress())
|
||||
gen.B.createDebugValueAddr(loc, argrv.getValue(), {PD->isLet(), ArgNo});
|
||||
else
|
||||
gen.B.createDebugValue(loc, argrv.getValue(), {PD->isLet(), ArgNo});
|
||||
|
||||
// A value bound to _ is unused and can be immediately released.
|
||||
Scope discardScope(gen.Cleanups, CleanupLocation(P));
|
||||
makeArgument(P->getType(), &*f.begin(), PD);
|
||||
// Popping the scope destroys the value.
|
||||
} else {
|
||||
makeArgumentIntoBinding(P->getType(), &*f.begin(), PD);
|
||||
|
||||
Reference in New Issue
Block a user