Merge pull request #69163 from apple/rebranch

Merge `rebranch` into `main` to support `stable/20230725` llvm-project branch
This commit is contained in:
Mishal Shah
2023-10-23 09:26:37 -07:00
committed by GitHub
395 changed files with 19840 additions and 2445 deletions

View File

@@ -863,13 +863,13 @@ class DiagnosticPrunedLiveness : public SSAPrunedLiveness {
/// A side array that stores any non lifetime ending uses we find in live out
/// blocks. This is used to enable our callers to emit errors on non-lifetime
/// ending uses that extend liveness into a loop body.
SmallSetVector<SILInstruction *, 8> *nonLifetimeEndingUsesInLiveOut;
llvm::SmallSetVector<SILInstruction *, 8> *nonLifetimeEndingUsesInLiveOut;
public:
DiagnosticPrunedLiveness(
SILFunction *function,
SmallVectorImpl<SILBasicBlock *> *discoveredBlocks = nullptr,
SmallSetVector<SILInstruction *, 8> *nonLifetimeEndingUsesInLiveOut =
llvm::SmallSetVector<SILInstruction *, 8> *nonLifetimeEndingUsesInLiveOut =
nullptr)
: SSAPrunedLiveness(function, discoveredBlocks),
nonLifetimeEndingUsesInLiveOut(nonLifetimeEndingUsesInLiveOut) {}

View File

@@ -396,20 +396,7 @@ public:
llvm::Optional<SILDebugVariable>
substituteAnonymousArgs(llvm::SmallString<4> Name,
llvm::Optional<SILDebugVariable> Var,
SILLocation Loc) {
if (Var && shouldDropVariable(*Var, Loc))
return {};
if (!Var || !Var->ArgNo || !Var->Name.empty())
return Var;
auto *VD = Loc.getAsASTNode<VarDecl>();
if (VD && !VD->getName().empty())
return Var;
llvm::raw_svector_ostream(Name) << '_' << (Var->ArgNo - 1);
Var->Name = Name;
return Var;
}
SILLocation Loc);
AllocStackInst *
createAllocStack(SILLocation Loc, SILType elementType,

View File

@@ -870,6 +870,10 @@ public:
/// current SILModule.
bool isPossiblyUsedExternally() const;
/// Helper method which returns whether this function should be preserved so
/// it can potentially be used in the debugger.
bool shouldBePreservedForDebugger() const;
/// In addition to isPossiblyUsedExternally() it returns also true if this
/// is a (private or internal) vtable method which can be referenced by
/// vtables of derived classes outside the compilation unit.