diff options
| author | Stephen Tozer <stephen.tozer@sony.com> | 2024-01-15 17:46:56 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-15 17:46:56 +0000 |
| commit | 304119860ac0ded0a126ab1c8cc30367e29ebd01 (patch) | |
| tree | 8c93725bba1685ae60e86c4dc6feab42cd9e0bdf /llvm/lib/Transforms/Utils/Local.cpp | |
| parent | c6dfb62d4df969fc50f42cf2889b10bb82f51b1f (diff) | |
| download | llvm-304119860ac0ded0a126ab1c8cc30367e29ebd01.zip llvm-304119860ac0ded0a126ab1c8cc30367e29ebd01.tar.gz llvm-304119860ac0ded0a126ab1c8cc30367e29ebd01.tar.bz2 | |
[DebugInfo][RemoveDIs][NFC] Split findDbgDeclares into two functions (#77478)
This patch follows on from comments on
https://github.com/llvm/llvm-project/pull/73498, implementing the
proposed split of findDbgDeclares into two separate functions for
DbgDeclareInsts and DPVDeclares, which return containers rather than
taking containers by reference.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b9cad76..d1b42f2 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -2130,9 +2130,8 @@ void llvm::insertDebugValuesForPHIs(BasicBlock *BB, bool llvm::replaceDbgDeclare(Value *Address, Value *NewAddress, DIBuilder &Builder, uint8_t DIExprFlags, int Offset) { - SmallVector<DbgDeclareInst *, 1> DbgDeclares; - SmallVector<DPValue *, 1> DPValues; - findDbgDeclares(DbgDeclares, Address, &DPValues); + TinyPtrVector<DbgDeclareInst *> DbgDeclares = findDbgDeclares(Address); + TinyPtrVector<DPValue *> DPVDeclares = findDPVDeclares(Address); auto ReplaceOne = [&](auto *DII) { assert(DII->getVariable() && "Missing variable"); @@ -2143,9 +2142,9 @@ bool llvm::replaceDbgDeclare(Value *Address, Value *NewAddress, }; for_each(DbgDeclares, ReplaceOne); - for_each(DPValues, ReplaceOne); + for_each(DPVDeclares, ReplaceOne); - return !DbgDeclares.empty() || !DPValues.empty(); + return !DbgDeclares.empty() || !DPVDeclares.empty(); } static void updateOneDbgValueForAlloca(const DebugLoc &Loc, |
