From aee45418287cdcc1387c56e0c0d08990c322b45b Mon Sep 17 00:00:00 2001 From: Andreas Simbuerger Date: Thu, 26 Jun 2014 11:09:13 +0000 Subject: [PATCH] Fix dangling reference llvm-svn: 211773 --- polly/include/polly/ScopDetectionDiagnostic.h | 3 +++ polly/lib/Analysis/ScopDetectionDiagnostic.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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; } //===----------------------------------------------------------------------===// -- 2.7.4