Coverage Report

Created: 2017-03-28 09:59

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/polly/include/polly/ScopDetectionDiagnostic.h
Line
Count
Source (jump to first uncovered line)
1
//=== ScopDetectionDiagnostic.h -- Diagnostic for ScopDetection -*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// Small set of diagnostic helper classes to encapsulate any errors occurred
11
// during the detection of Scops.
12
//
13
// The ScopDetection defines a set of error classes (via Statistic variables)
14
// that groups a number of individual errors into a group, e.g. non-affinity
15
// related errors.
16
// On error we generate an object that carries enough additional information
17
// to diagnose the error and generate a helpful error message.
18
//
19
//===----------------------------------------------------------------------===//
20
#ifndef POLLY_SCOP_DETECTION_DIAGNOSTIC_H
21
#define POLLY_SCOP_DETECTION_DIAGNOSTIC_H
22
23
#include "llvm/ADT/SmallVector.h"
24
#include "llvm/ADT/Statistic.h"
25
#include "llvm/ADT/Twine.h"
26
#include "llvm/Analysis/AliasSetTracker.h"
27
#include "llvm/Analysis/LoopInfo.h"
28
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
29
#include "llvm/IR/BasicBlock.h"
30
#include "llvm/IR/Value.h"
31
#include "llvm/Support/Casting.h"
32
#include <memory>
33
#include <string>
34
35
using namespace llvm;
36
37
namespace llvm {
38
class SCEV;
39
class BasicBlock;
40
class Value;
41
class Region;
42
} // namespace llvm
43
44
namespace polly {
45
46
/// Type to hold region delimiters (entry & exit block).
47
using BBPair = std::pair<BasicBlock *, BasicBlock *>;
48
49
/// Return the region delimiters (entry & exit block) of @p R.
50
BBPair getBBPairForRegion(const Region *R);
51
52
/// Set the begin and end source location for the region limited by @p P.
53
void getDebugLocations(const BBPair &P, DebugLoc &Begin, DebugLoc &End);
54
55
class RejectLog;
56
/// Emit optimization remarks about the rejected regions to the user.
57
///
58
/// This emits the content of the reject log as optimization remarks.
59
/// Remember to at least track failures (-polly-detect-track-failures).
60
/// @param P The region delimiters (entry & exit) we emit remarks for.
61
/// @param Log The error log containing all messages being emitted as remark.
62
void emitRejectionRemarks(const BBPair &P, const RejectLog &Log);
63
64
// Discriminator for LLVM-style RTTI (dyn_cast<> et al.)
65
enum class RejectReasonKind {
66
  // CFG Category
67
  CFG,
68
  InvalidTerminator,
69
  IrreducibleRegion,
70
  UnreachableInExit,
71
  LastCFG,
72
73
  // Non-Affinity
74
  AffFunc,
75
  UndefCond,
76
  InvalidCond,
77
  UndefOperand,
78
  NonAffBranch,
79
  NoBasePtr,
80
  UndefBasePtr,
81
  VariantBasePtr,
82
  NonAffineAccess,
83
  DifferentElementSize,
84
  LastAffFunc,
85
86
  LoopBound,
87
  LoopHasNoExit,
88
89
  FuncCall,
90
  NonSimpleMemoryAccess,
91
92
  Alias,
93
94
  // Other
95
  Other,
96
  IntToPtr,
97
  Alloca,
98
  UnknownInst,
99
  Entry,
100
  Unprofitable,
101
  LastOther
102
};
103
104
//===----------------------------------------------------------------------===//
105
/// Base class of all reject reasons found during Scop detection.
106
///
107
/// Subclasses of RejectReason should provide means to capture enough
108
/// diagnostic information to help clients figure out what and where something
109
/// went wrong in the Scop detection.
110
class RejectReason {
111
  //===--------------------------------------------------------------------===//
112
private:
113
  const RejectReasonKind Kind;
114
115
protected:
116
  static const DebugLoc Unknown;
117
118
public:
119
0
  RejectReasonKind getKind() const { return Kind; }
120
121
  RejectReason(RejectReasonKind K);
122
123
587
  virtual ~RejectReason() {}
124
125
  /// Generate a reasonable diagnostic message describing this error.
126
  ///
127
  /// @return A debug message representing this error.
128
  virtual std::string getMessage() const = 0;
129
130
  /// Generate a message for the end-user describing this error.
131
  ///
132
  /// The message provided has to be suitable for the end-user. So it should
133
  /// not reference any LLVM internal data structures or terminology.
134
  /// Ideally, the message helps the end-user to increase the size of the
135
  /// regions amenable to Polly.
136
  ///
137
  /// @return A short message representing this error.
138
182
  virtual std::string getEndUserMessage() const { return "Unspecified error."; }
139
140
  /// Get the source location of this error.
141
  ///
142
  /// @return The debug location for this error.
143
  virtual const llvm::DebugLoc &getDebugLoc() const;
144
};
145
146
typedef std::shared_ptr<RejectReason> RejectReasonPtr;
147
148
/// Stores all errors that ocurred during the detection.
149
class RejectLog {
150
  Region *R;
151
  llvm::SmallVector<RejectReasonPtr, 1> ErrorReports;
152
153
public:
154
4.15k
  explicit RejectLog(Region *R) : R(R) {}
155
156
  typedef llvm::SmallVector<RejectReasonPtr, 1>::const_iterator iterator;
157
158
430
  iterator begin() const { return ErrorReports.begin(); }
159
430
  iterator end() const { return ErrorReports.end(); }
160
9.02k
  size_t size() const { return ErrorReports.size(); }
161
162
  /// Returns true, if we store at least one error.
163
  ///
164
  /// @return true, if we store at least one error.
165
7.81k
  bool hasErrors() const { return size() > 0; }
166
167
  void print(raw_ostream &OS, int level = 0) const;
168
169
0
  const Region *region() const { return R; }
170
587
  void report(RejectReasonPtr Reject) { ErrorReports.push_back(Reject); }
171
};
172
173
//===----------------------------------------------------------------------===//
174
/// Base class for CFG related reject reasons.
175
///
176
/// Scop candidates that violate structural restrictions can be grouped under
177
/// this reject reason class.
178
class ReportCFG : public RejectReason {
179
  //===--------------------------------------------------------------------===//
180
public:
181
  ReportCFG(const RejectReasonKind K);
182
183
  /// @name LLVM-RTTI interface
184
  //@{
185
  static bool classof(const RejectReason *RR);
186
  //@}
187
};
188
189
//===----------------------------------------------------------------------===//
190
/// Captures bad terminator within a Scop candidate.
191
class ReportInvalidTerminator : public ReportCFG {
192
  BasicBlock *BB;
193
194
public:
195
  ReportInvalidTerminator(BasicBlock *BB)
196
0
      : ReportCFG(RejectReasonKind::InvalidTerminator), BB(BB) {}
197
198
  /// @name LLVM-RTTI interface
199
  //@{
200
  static bool classof(const RejectReason *RR);
201
  //@}
202
203
  /// @name RejectReason interface
204
  //@{
205
  virtual std::string getMessage() const override;
206
  virtual const DebugLoc &getDebugLoc() const override;
207
  //@}
208
};
209
210
//===----------------------------------------------------------------------===//
211
/// Captures irreducible regions in CFG.
212
class ReportIrreducibleRegion : public ReportCFG {
213
  Region *R;
214
  DebugLoc DbgLoc;
215
216
public:
217
  ReportIrreducibleRegion(Region *R, DebugLoc DbgLoc)
218
3
      : ReportCFG(RejectReasonKind::IrreducibleRegion), R(R), DbgLoc(DbgLoc) {}
219
220
  /// @name LLVM-RTTI interface
221
  //@{
222
  static bool classof(const RejectReason *RR);
223
  //@}
224
225
  /// @name RejectReason interface
226
  //@{
227
  virtual std::string getMessage() const override;
228
  virtual std::string getEndUserMessage() const override;
229
  virtual const DebugLoc &getDebugLoc() const override;
230
  //@}
231
};
232
233
//===----------------------------------------------------------------------===//
234
/// Captures regions with an unreachable in the exit block.
235
class ReportUnreachableInExit : public ReportCFG {
236
  BasicBlock *BB;
237
  DebugLoc DbgLoc;
238
239
public:
240
  ReportUnreachableInExit(BasicBlock *BB, DebugLoc DbgLoc)
241
26
      : ReportCFG(RejectReasonKind::UnreachableInExit), BB(BB), DbgLoc(DbgLoc) {
242
26
  }
243
244
  /// @name LLVM-RTTI interface
245
  //@{
246
  static bool classof(const RejectReason *RR);
247
  //@}
248
249
  /// @name RejectReason interface
250
  //@{
251
  virtual std::string getMessage() const override;
252
  virtual std::string getEndUserMessage() const override;
253
  virtual const DebugLoc &getDebugLoc() const override;
254
  //@}
255
};
256
257
//===----------------------------------------------------------------------===//
258
/// Base class for non-affine reject reasons.
259
///
260
/// Scop candidates that violate restrictions to affinity are reported under
261
/// this class.
262
class ReportAffFunc : public RejectReason {
263
  //===--------------------------------------------------------------------===//
264
265
  // The instruction that caused non-affinity to occur.
266
  const Instruction *Inst;
267
268
public:
269
  ReportAffFunc(const RejectReasonKind K, const Instruction *Inst);
270
271
  /// @name LLVM-RTTI interface
272
  //@{
273
  static bool classof(const RejectReason *RR);
274
  //@}
275
276
  /// @name RejectReason interface
277
  //@{
278
216
  virtual const DebugLoc &getDebugLoc() const override {
279
216
    return Inst->getDebugLoc();
280
216
  }
281
  //@}
282
};
283
284
//===----------------------------------------------------------------------===//
285
/// Captures a condition that is based on an 'undef' value.
286
class ReportUndefCond : public ReportAffFunc {
287
  //===--------------------------------------------------------------------===//
288
289
  // The BasicBlock we found the broken condition in.
290
  BasicBlock *BB;
291
292
public:
293
  ReportUndefCond(const Instruction *Inst, BasicBlock *BB)
294
154
      : ReportAffFunc(RejectReasonKind::UndefCond, Inst), BB(BB) {}
295
296
  /// @name LLVM-RTTI interface
297
  //@{
298
  static bool classof(const RejectReason *RR);
299
  //@}
300
301
  /// @name RejectReason interface
302
  //@{
303
  virtual std::string getMessage() const override;
304
  //@}
305
};
306
307
//===----------------------------------------------------------------------===//
308
/// Captures an invalid condition
309
///
310
/// Conditions have to be either constants or icmp instructions.
311
class ReportInvalidCond : public ReportAffFunc {
312
  //===--------------------------------------------------------------------===//
313
314
  // The BasicBlock we found the broken condition in.
315
  BasicBlock *BB;
316
317
public:
318
  ReportInvalidCond(const Instruction *Inst, BasicBlock *BB)
319
0
      : ReportAffFunc(RejectReasonKind::InvalidCond, Inst), BB(BB) {}
320
321
  /// @name LLVM-RTTI interface
322
  //@{
323
  static bool classof(const RejectReason *RR);
324
  //@}
325
326
  /// @name RejectReason interface
327
  //@{
328
  virtual std::string getMessage() const override;
329
  //@}
330
};
331
332
//===----------------------------------------------------------------------===//
333
/// Captures an undefined operand.
334
class ReportUndefOperand : public ReportAffFunc {
335
  //===--------------------------------------------------------------------===//
336
337
  // The BasicBlock we found the undefined operand in.
338
  BasicBlock *BB;
339
340
public:
341
  ReportUndefOperand(BasicBlock *BB, const Instruction *Inst)
342
5
      : ReportAffFunc(RejectReasonKind::UndefOperand, Inst), BB(BB) {}
343
344
  /// @name LLVM-RTTI interface
345
  //@{
346
  static bool classof(const RejectReason *RR);
347
  //@}
348
349
  /// @name RejectReason interface
350
  //@{
351
  virtual std::string getMessage() const override;
352
  //@}
353
};
354
355
//===----------------------------------------------------------------------===//
356
/// Captures a non-affine branch.
357
class ReportNonAffBranch : public ReportAffFunc {
358
  //===--------------------------------------------------------------------===//
359
360
  // The BasicBlock we found the non-affine branch in.
361
  BasicBlock *BB;
362
363
  /// LHS & RHS of the failed condition.
364
  //@{
365
  const SCEV *LHS;
366
  const SCEV *RHS;
367
  //@}
368
369
public:
370
  ReportNonAffBranch(BasicBlock *BB, const SCEV *LHS, const SCEV *RHS,
371
                     const Instruction *Inst)
372
      : ReportAffFunc(RejectReasonKind::NonAffBranch, Inst), BB(BB), LHS(LHS),
373
5
        RHS(RHS) {}
374
375
0
  const SCEV *lhs() { return LHS; }
376
0
  const SCEV *rhs() { return RHS; }
377
378
  /// @name LLVM-RTTI interface
379
  //@{
380
  static bool classof(const RejectReason *RR);
381
  //@}
382
383
  /// @name RejectReason interface
384
  //@{
385
  virtual std::string getMessage() const override;
386
  //@}
387
};
388
389
//===----------------------------------------------------------------------===//
390
/// Captures a missing base pointer.
391
class ReportNoBasePtr : public ReportAffFunc {
392
  //===--------------------------------------------------------------------===//
393
public:
394
  ReportNoBasePtr(const Instruction *Inst)
395
0
      : ReportAffFunc(RejectReasonKind::NoBasePtr, Inst) {}
396
397
  /// @name LLVM-RTTI interface
398
  //@{
399
  static bool classof(const RejectReason *RR);
400
  //@}
401
402
  /// @name RejectReason interface
403
  //@{
404
  virtual std::string getMessage() const override;
405
  //@}
406
};
407
408
//===----------------------------------------------------------------------===//
409
/// Captures an undefined base pointer.
410
class ReportUndefBasePtr : public ReportAffFunc {
411
  //===--------------------------------------------------------------------===//
412
public:
413
  ReportUndefBasePtr(const Instruction *Inst)
414
5
      : ReportAffFunc(RejectReasonKind::UndefBasePtr, Inst) {}
415
416
  /// @name LLVM-RTTI interface
417
  //@{
418
  static bool classof(const RejectReason *RR);
419
  //@}
420
421
  /// @name RejectReason interface
422
  //@{
423
  virtual std::string getMessage() const override;
424
  //@}
425
};
426
427
//===----------------------------------------------------------------------===//
428
/// Captures a base pointer that is not invariant in the region.
429
class ReportVariantBasePtr : public ReportAffFunc {
430
  //===--------------------------------------------------------------------===//
431
432
  // The variant base pointer.
433
  Value *BaseValue;
434
435
public:
436
  ReportVariantBasePtr(Value *BaseValue, const Instruction *Inst)
437
      : ReportAffFunc(RejectReasonKind::VariantBasePtr, Inst),
438
10
        BaseValue(BaseValue) {}
439
440
  /// @name LLVM-RTTI interface
441
  //@{
442
  static bool classof(const RejectReason *RR);
443
  //@}
444
445
  /// @name RejectReason interface
446
  //@{
447
  virtual std::string getMessage() const override;
448
  virtual std::string getEndUserMessage() const override;
449
  //@}
450
};
451
452
//===----------------------------------------------------------------------===//
453
/// Captures a non-affine access function.
454
class ReportNonAffineAccess : public ReportAffFunc {
455
  //===--------------------------------------------------------------------===//
456
457
  // The non-affine access function.
458
  const SCEV *AccessFunction;
459
460
  // The base pointer of the memory access.
461
  const Value *BaseValue;
462
463
public:
464
  ReportNonAffineAccess(const SCEV *AccessFunction, const Instruction *Inst,
465
                        const Value *V)
466
      : ReportAffFunc(RejectReasonKind::NonAffineAccess, Inst),
467
56
        AccessFunction(AccessFunction), BaseValue(V) {}
468
469
0
  const SCEV *get() { return AccessFunction; }
470
471
  /// @name LLVM-RTTI interface
472
  //@{
473
  static bool classof(const RejectReason *RR);
474
  //@}
475
476
  /// @name RejectReason interface
477
  //@{
478
  virtual std::string getMessage() const override;
479
  virtual std::string getEndUserMessage() const override;
480
  //@}
481
};
482
483
//===----------------------------------------------------------------------===//
484
/// Report array accesses with differing element size.
485
class ReportDifferentArrayElementSize : public ReportAffFunc {
486
  //===--------------------------------------------------------------------===//
487
488
  // The base pointer of the memory access.
489
  const Value *BaseValue;
490
491
public:
492
  ReportDifferentArrayElementSize(const Instruction *Inst, const Value *V)
493
      : ReportAffFunc(RejectReasonKind::DifferentElementSize, Inst),
494
0
        BaseValue(V) {}
495
496
  /// @name LLVM-RTTI interface
497
  //@{
498
  static bool classof(const RejectReason *RR);
499
  //@}
500
501
  /// @name RejectReason interface
502
  //@{
503
  virtual std::string getMessage() const override;
504
  virtual std::string getEndUserMessage() const override;
505
  //@}
506
};
507
508
//===----------------------------------------------------------------------===//
509
/// Captures errors with non affine loop bounds.
510
class ReportLoopBound : public RejectReason {
511
  //===--------------------------------------------------------------------===//
512
513
  // The offending loop.
514
  Loop *L;
515
516
  // The non-affine loop bound.
517
  const SCEV *LoopCount;
518
519
  // A copy of the offending loop's debug location.
520
  const DebugLoc Loc;
521
522
public:
523
  ReportLoopBound(Loop *L, const SCEV *LoopCount);
524
525
0
  const SCEV *loopCount() { return LoopCount; }
526
527
  /// @name LLVM-RTTI interface
528
  //@{
529
  static bool classof(const RejectReason *RR);
530
  //@}
531
532
  /// @name RejectReason interface
533
  //@{
534
  virtual std::string getMessage() const override;
535
  virtual const DebugLoc &getDebugLoc() const override;
536
  virtual std::string getEndUserMessage() const override;
537
  //@}
538
};
539
540
//===----------------------------------------------------------------------===//
541
/// Captures errors when loop has no exit.
542
class ReportLoopHasNoExit : public RejectReason {
543
  //===--------------------------------------------------------------------===//
544
545
  /// The loop that has no exit.
546
  Loop *L;
547
548
  const DebugLoc Loc;
549
550
public:
551
  ReportLoopHasNoExit(Loop *L)
552
      : RejectReason(RejectReasonKind::LoopHasNoExit), L(L),
553
16
        Loc(L->getStartLoc()) {}
554
555
  /// @name LLVM-RTTI interface
556
  //@{
557
  static bool classof(const RejectReason *RR);
558
  //@}
559
560
  /// @name RejectReason interface
561
  //@{
562
  virtual std::string getMessage() const override;
563
  virtual const DebugLoc &getDebugLoc() const override;
564
  virtual std::string getEndUserMessage() const override;
565
  //@}
566
};
567
568
//===----------------------------------------------------------------------===//
569
/// Captures errors with non-side-effect-known function calls.
570
class ReportFuncCall : public RejectReason {
571
  //===--------------------------------------------------------------------===//
572
573
  // The offending call instruction.
574
  Instruction *Inst;
575
576
public:
577
  ReportFuncCall(Instruction *Inst);
578
579
  /// @name LLVM-RTTI interface
580
  //@{
581
  static bool classof(const RejectReason *RR);
582
  //@}
583
584
  /// @name RejectReason interface
585
  //@{
586
  virtual std::string getMessage() const override;
587
  virtual const DebugLoc &getDebugLoc() const override;
588
  virtual std::string getEndUserMessage() const override;
589
  //@}
590
};
591
592
//===----------------------------------------------------------------------===//
593
/// Captures errors with aliasing.
594
class ReportAlias : public RejectReason {
595
  //===--------------------------------------------------------------------===//
596
public:
597
  typedef std::vector<const llvm::Value *> PointerSnapshotTy;
598
599
private:
600
  /// Format an invalid alias set.
601
  ///
602
  //  @param Prefix A prefix string to put before the list of aliasing pointers.
603
  //  @param Suffix A suffix string to put after the list of aliasing pointers.
604
  std::string formatInvalidAlias(std::string Prefix = "",
605
                                 std::string Suffix = "") const;
606
607
  Instruction *Inst;
608
609
  // A snapshot of the llvm values that took part in the aliasing error.
610
  mutable PointerSnapshotTy Pointers;
611
612
public:
613
  ReportAlias(Instruction *Inst, AliasSet &AS);
614
615
0
  const PointerSnapshotTy &getPointers() const { return Pointers; }
616
617
  /// @name LLVM-RTTI interface
618
  //@{
619
  static bool classof(const RejectReason *RR);
620
  //@}
621
622
  /// @name RejectReason interface
623
  //@{
624
  virtual std::string getMessage() const override;
625
  virtual const DebugLoc &getDebugLoc() const override;
626
  virtual std::string getEndUserMessage() const override;
627
  //@}
628
};
629
630
//===----------------------------------------------------------------------===//
631
/// Base class for otherwise ungrouped reject reasons.
632
class ReportOther : public RejectReason {
633
  //===--------------------------------------------------------------------===//
634
public:
635
  ReportOther(const RejectReasonKind K);
636
637
  /// @name LLVM-RTTI interface
638
  //@{
639
  static bool classof(const RejectReason *RR);
640
  //@}
641
642
  /// @name RejectReason interface
643
  //@{
644
  virtual std::string getMessage() const override;
645
  //@}
646
};
647
648
//===----------------------------------------------------------------------===//
649
/// Captures errors with bad IntToPtr instructions.
650
class ReportIntToPtr : public ReportOther {
651
  //===--------------------------------------------------------------------===//
652
653
  // The offending base value.
654
  Instruction *BaseValue;
655
656
public:
657
  ReportIntToPtr(Instruction *BaseValue);
658
659
  /// @name LLVM-RTTI interface
660
  //@{
661
  static bool classof(const RejectReason *RR);
662
  //@}
663
664
  /// @name RejectReason interface
665
  //@{
666
  virtual std::string getMessage() const override;
667
  virtual const DebugLoc &getDebugLoc() const override;
668
  //@}
669
};
670
671
//===----------------------------------------------------------------------===//
672
/// Captures errors with alloca instructions.
673
class ReportAlloca : public ReportOther {
674
  //===--------------------------------------------------------------------===//
675
  Instruction *Inst;
676
677
public:
678
  ReportAlloca(Instruction *Inst);
679
680
  /// @name LLVM-RTTI interface
681
  //@{
682
  static bool classof(const RejectReason *RR);
683
  //@}
684
685
  /// @name RejectReason interface
686
  //@{
687
  virtual std::string getMessage() const override;
688
  virtual const DebugLoc &getDebugLoc() const override;
689
  //@}
690
};
691
692
//===----------------------------------------------------------------------===//
693
/// Captures errors with unknown instructions.
694
class ReportUnknownInst : public ReportOther {
695
  //===--------------------------------------------------------------------===//
696
  Instruction *Inst;
697
698
public:
699
  ReportUnknownInst(Instruction *Inst);
700
701
  /// @name LLVM-RTTI interface
702
  //@{
703
  static bool classof(const RejectReason *RR);
704
  //@}
705
706
  /// @name RejectReason interface
707
  //@{
708
  virtual std::string getMessage() const override;
709
  virtual const DebugLoc &getDebugLoc() const override;
710
  //@}
711
};
712
713
//===----------------------------------------------------------------------===//
714
/// Captures errors with regions containing the function entry block.
715
class ReportEntry : public ReportOther {
716
  //===--------------------------------------------------------------------===//
717
  BasicBlock *BB;
718
719
public:
720
  ReportEntry(BasicBlock *BB);
721
722
  /// @name LLVM-RTTI interface
723
  //@{
724
  static bool classof(const RejectReason *RR);
725
  //@}
726
727
  /// @name RejectReason interface
728
  //@{
729
  virtual std::string getMessage() const override;
730
  virtual std::string getEndUserMessage() const override;
731
  virtual const DebugLoc &getDebugLoc() const override;
732
  //@}
733
};
734
735
//===----------------------------------------------------------------------===//
736
/// Report regions that seem not profitable to be optimized.
737
class ReportUnprofitable : public ReportOther {
738
  //===--------------------------------------------------------------------===//
739
  Region *R;
740
741
public:
742
  ReportUnprofitable(Region *R);
743
744
  /// @name LLVM-RTTI interface
745
  //@{
746
  static bool classof(const RejectReason *RR);
747
  //@}
748
749
  /// @name RejectReason interface
750
  //@{
751
  virtual std::string getMessage() const override;
752
  virtual std::string getEndUserMessage() const override;
753
  virtual const DebugLoc &getDebugLoc() const override;
754
  //@}
755
};
756
757
//===----------------------------------------------------------------------===//
758
/// Captures errors with non-simple memory accesses.
759
class ReportNonSimpleMemoryAccess : public ReportOther {
760
  //===--------------------------------------------------------------------===//
761
762
  // The offending call instruction.
763
  Instruction *Inst;
764
765
public:
766
  ReportNonSimpleMemoryAccess(Instruction *Inst);
767
768
  /// @name LLVM-RTTI interface
769
  //@{
770
  static bool classof(const RejectReason *RR);
771
  //@}
772
773
  /// @name RejectReason interface
774
  //@{
775
  virtual std::string getMessage() const override;
776
  virtual const DebugLoc &getDebugLoc() const override;
777
  virtual std::string getEndUserMessage() const override;
778
  //@}
779
};
780
781
} // namespace polly
782
783
#endif // POLLY_SCOP_DETECTION_DIAGNOSTIC_H