LexicalScopes: Cleanup remaining uses of DebugLoc
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 30 Mar 2015 23:58:59 +0000 (23:58 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 30 Mar 2015 23:58:59 +0000 (23:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233644 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LexicalScopes.cpp

index 45f312bb7b1aecbcc0caf3b88478ed2a9813b8d2..fc12b8ff3ffa99638a472bf5e77ff720388c8237 100644 (file)
@@ -59,10 +59,10 @@ void LexicalScopes::extractLexicalScopes(
   for (const auto &MBB : *MF) {
     const MachineInstr *RangeBeginMI = nullptr;
     const MachineInstr *PrevMI = nullptr;
-    DebugLoc PrevDL;
+    const MDLocation *PrevDL = nullptr;
     for (const auto &MInsn : MBB) {
       // Check if instruction has valid location information.
-      const DebugLoc &MIDL = MInsn.getDebugLoc();
+      const MDLocation *MIDL = MInsn.getDebugLoc();
       if (!MIDL) {
         PrevMI = &MInsn;
         continue;
@@ -314,12 +314,10 @@ bool LexicalScopes::dominates(const MDLocation *DL, MachineBasicBlock *MBB) {
   bool Result = false;
   for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E;
        ++I) {
-    DebugLoc IDL = I->getDebugLoc();
-    if (!IDL)
-      continue;
-    if (LexicalScope *IScope = getOrCreateLexicalScope(IDL))
-      if (Scope->dominates(IScope))
-        return true;
+    if (const MDLocation *IDL = I->getDebugLoc())
+      if (LexicalScope *IScope = getOrCreateLexicalScope(IDL))
+        if (Scope->dominates(IScope))
+          return true;
   }
   return Result;
 }