[llvm] r233644 - LexicalScopes: Cleanup remaining uses of DebugLoc

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Mar 30 16:58:59 PDT 2015


Author: dexonsmith
Date: Mon Mar 30 18:58:59 2015
New Revision: 233644

URL: http://llvm.org/viewvc/llvm-project?rev=233644&view=rev
Log:
LexicalScopes: Cleanup remaining uses of DebugLoc

Modified:
    llvm/trunk/lib/CodeGen/LexicalScopes.cpp

Modified: llvm/trunk/lib/CodeGen/LexicalScopes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LexicalScopes.cpp?rev=233644&r1=233643&r2=233644&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LexicalScopes.cpp (original)
+++ llvm/trunk/lib/CodeGen/LexicalScopes.cpp Mon Mar 30 18:58:59 2015
@@ -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 MDLo
   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;
 }





More information about the llvm-commits mailing list