summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Simbuerger <simbuerg@fim.uni-passau.de>2014-06-26 11:09:13 +0000
committerAndreas Simbuerger <simbuerg@fim.uni-passau.de>2014-06-26 11:09:13 +0000
commitaee45418287cdcc1387c56e0c0d08990c322b45b (patch)
treedf2c21eccbb991572f89953ca5574464899cf1ff
parent65e24646679c90ba6f0bce9933b7182f1f597834 (diff)
downloadbcm5719-llvm-aee45418287cdcc1387c56e0c0d08990c322b45b.tar.gz
bcm5719-llvm-aee45418287cdcc1387c56e0c0d08990c322b45b.zip
Fix dangling reference
llvm-svn: 211773
-rw-r--r--polly/include/polly/ScopDetectionDiagnostic.h3
-rw-r--r--polly/lib/Analysis/ScopDetectionDiagnostic.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/polly/include/polly/ScopDetectionDiagnostic.h b/polly/include/polly/ScopDetectionDiagnostic.h
index f7f826bfb82..90cd7f2e99c 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 8fde51aff2f..584f4a43299 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<DebugLoc>().get());
+ return Unknown;
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud