From: Andreas Simbuerger Date: Thu, 26 Jun 2014 11:09:13 +0000 (+0000) Subject: Fix dangling reference X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aee45418287cdcc1387c56e0c0d08990c322b45b;p=platform%2Fupstream%2Fllvm.git Fix dangling reference llvm-svn: 211773 --- diff --git a/polly/include/polly/ScopDetectionDiagnostic.h b/polly/include/polly/ScopDetectionDiagnostic.h index f7f826b..90cd7f2 100644 --- a/polly/include/polly/ScopDetectionDiagnostic.h +++ b/polly/include/polly/ScopDetectionDiagnostic.h @@ -126,6 +126,9 @@ class RejectReason { private: const RejectReasonKind Kind; +protected: + static const DebugLoc Unknown; + public: RejectReasonKind getKind() const { return Kind; } diff --git a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp index 8fde51a..584f4a4 100644 --- a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp +++ b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp @@ -118,10 +118,11 @@ void emitValidRemarks(const llvm::Function &F, const Region *R) { //===----------------------------------------------------------------------===// // RejectReason. +const DebugLoc RejectReason::Unknown = DebugLoc(); const llvm::DebugLoc &RejectReason::getDebugLoc() const { // Allocate an empty DebugLoc and return it a reference to it. - return *(std::make_shared().get()); + return Unknown; } //===----------------------------------------------------------------------===//