[polly] r233605 - DebugInfo: Use the new DebugLoc API from r233573

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Mar 30 14:47:17 PDT 2015


Author: dexonsmith
Date: Mon Mar 30 16:47:17 2015
New Revision: 233605

URL: http://llvm.org/viewvc/llvm-project?rev=233605&view=rev
Log:
DebugInfo: Use the new DebugLoc API from r233573

This should fix the build [1] after r233599 removed the old API.

[1]: http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-parallel-fast/builds/5265

Modified:
    polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp

Modified: polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp?rev=233605&r1=233604&r2=233605&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp Mon Mar 30 16:47:17 2015
@@ -69,10 +69,10 @@ void getDebugLocation(const Region *R, u
   for (const BasicBlock *BB : R->blocks())
     for (const Instruction &Inst : *BB) {
       DebugLoc DL = Inst.getDebugLoc();
-      if (DL.isUnknown())
+      if (!DL)
         continue;
 
-      DIScope Scope(DL.getScope(Inst.getContext()));
+      DIScope Scope(DL.getScope());
 
       if (FileName.empty())
         FileName = Scope.getFilename();
@@ -98,11 +98,11 @@ static void getDebugLocations(const Regi
   for (const BasicBlock *BB : R->blocks())
     for (const Instruction &Inst : *BB) {
       DebugLoc DL = Inst.getDebugLoc();
-      if (DL.isUnknown())
+      if (!DL)
         continue;
 
-      Begin = Begin.isUnknown() ? DL : std::min(Begin, DL);
-      End = End.isUnknown() ? DL : std::max(End, DL);
+      Begin = Begin ? std::min(Begin, DL) : DL;
+      End = End ? std::max(End, DL) : DL;
     }
 }
 
@@ -119,8 +119,7 @@ void emitRejectionRemarks(const llvm::Fu
       "The following errors keep this region from being a Scop.");
 
   for (RejectReasonPtr RR : Log) {
-    const DebugLoc &Loc = RR->getDebugLoc();
-    if (!Loc.isUnknown())
+    if (const DebugLoc &Loc = RR->getDebugLoc())
       emitOptimizationRemarkMissed(Ctx, DEBUG_TYPE, F, Loc,
                                    RR->getEndUserMessage());
   }
@@ -607,11 +606,9 @@ std::string ReportUnprofitable::getEndUs
 
 const DebugLoc &ReportUnprofitable::getDebugLoc() const {
   for (const BasicBlock *BB : R->blocks())
-    for (const Instruction &Inst : *BB) {
-      const DebugLoc &DL = Inst.getDebugLoc();
-      if (!DL.isUnknown())
+    for (const Instruction &Inst : *BB)
+      if (const DebugLoc &DL = Inst.getDebugLoc())
         return DL;
-    }
 
   return R->getEntry()->getTerminator()->getDebugLoc();
 }





More information about the llvm-commits mailing list