From ef72e481ea11f5e1954bf3af41e2dc78f15836e3 Mon Sep 17 00:00:00 2001 From: Hsiangkai Wang Date: Mon, 6 Aug 2018 03:59:47 +0000 Subject: [DebugInfo] Refactor DbgInfoIntrinsic class hierarchy. In the past, DbgInfoIntrinsic has a strong assumption that these intrinsics all have variables and expressions attached to them. However, it is too strong to derive the class for other debug entities. Now, it has problems for debug labels. In order to make DbgInfoIntrinsic as a base class for 'debug info', I create a class for 'variable debug info', DbgVariableIntrinsic. DbgDeclareInst, DbgAddrIntrinsic, and DbgValueInst will be derived from it. Differential Revision: https://reviews.llvm.org/D50220 llvm-svn: 338984 --- llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/Utils/LoopRotationUtils.cpp') diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp index 0f58f18bc87..514c594ddfa 100644 --- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp @@ -304,13 +304,13 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { // Record all debug intrinsics preceding LoopEntryBranch to avoid duplication. using DbgIntrinsicHash = std::pair, DIExpression *>; - auto makeHash = [](DbgInfoIntrinsic *D) -> DbgIntrinsicHash { + auto makeHash = [](DbgVariableIntrinsic *D) -> DbgIntrinsicHash { return {{D->getVariableLocation(), D->getVariable()}, D->getExpression()}; }; SmallDenseSet DbgIntrinsics; for (auto I = std::next(OrigPreheader->rbegin()), E = OrigPreheader->rend(); I != E; ++I) { - if (auto *DII = dyn_cast(&*I)) + if (auto *DII = dyn_cast(&*I)) DbgIntrinsics.insert(makeHash(DII)); else break; @@ -340,7 +340,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { RF_NoModuleLevelChanges | RF_IgnoreMissingLocals); // Avoid inserting the same intrinsic twice. - if (auto *DII = dyn_cast(C)) + if (auto *DII = dyn_cast(C)) if (DbgIntrinsics.count(makeHash(DII))) { C->deleteValue(); continue; -- cgit v1.2.3