Demote a single-use named function object to a lambda
[oota-llvm.git] / include / llvm / IR / DiagnosticInfo.h
1 //===- llvm/Support/DiagnosticInfo.h - Diagnostic Declaration ---*- 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 // This file declares the different classes involved in low level diagnostics.
11 //
12 // Diagnostics reporting is still done as part of the LLVMContext.
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_IR_DIAGNOSTICINFO_H
16 #define LLVM_IR_DIAGNOSTICINFO_H
17
18 #include "llvm-c/Core.h"
19 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/IR/DebugLoc.h"
21 #include "llvm/IR/Module.h"
22 #include "llvm/Support/Casting.h"
23 #include <functional>
24
25 namespace llvm {
26
27 // Forward declarations.
28 class DiagnosticPrinter;
29 class Function;
30 class Instruction;
31 class LLVMContextImpl;
32 class Twine;
33 class Value;
34 class DebugLoc;
35 class SMDiagnostic;
36
37 /// \brief Defines the different supported severity of a diagnostic.
38 enum DiagnosticSeverity {
39   DS_Error,
40   DS_Warning,
41   DS_Remark,
42   // A note attaches additional information to one of the previous diagnostic
43   // types.
44   DS_Note
45 };
46
47 /// \brief Defines the different supported kind of a diagnostic.
48 /// This enum should be extended with a new ID for each added concrete subclass.
49 enum DiagnosticKind {
50   DK_Bitcode,
51   DK_InlineAsm,
52   DK_StackSize,
53   DK_Linker,
54   DK_DebugMetadataVersion,
55   DK_SampleProfile,
56   DK_OptimizationRemark,
57   DK_OptimizationRemarkMissed,
58   DK_OptimizationRemarkAnalysis,
59   DK_OptimizationRemarkAnalysisFPCommute,
60   DK_OptimizationRemarkAnalysisAliasing,
61   DK_OptimizationFailure,
62   DK_MIRParser,
63   DK_FirstPluginKind
64 };
65
66 /// \brief Get the next available kind ID for a plugin diagnostic.
67 /// Each time this function is called, it returns a different number.
68 /// Therefore, a plugin that wants to "identify" its own classes
69 /// with a dynamic identifier, just have to use this method to get a new ID
70 /// and assign it to each of its classes.
71 /// The returned ID will be greater than or equal to DK_FirstPluginKind.
72 /// Thus, the plugin identifiers will not conflict with the
73 /// DiagnosticKind values.
74 int getNextAvailablePluginDiagnosticKind();
75
76 /// \brief This is the base abstract class for diagnostic reporting in
77 /// the backend.
78 /// The print method must be overloaded by the subclasses to print a
79 /// user-friendly message in the client of the backend (let us call it a
80 /// frontend).
81 class DiagnosticInfo {
82 private:
83   /// Kind defines the kind of report this is about.
84   const /* DiagnosticKind */ int Kind;
85   /// Severity gives the severity of the diagnostic.
86   const DiagnosticSeverity Severity;
87
88 public:
89   DiagnosticInfo(/* DiagnosticKind */ int Kind, DiagnosticSeverity Severity)
90       : Kind(Kind), Severity(Severity) {}
91
92   virtual ~DiagnosticInfo() {}
93
94   /* DiagnosticKind */ int getKind() const { return Kind; }
95   DiagnosticSeverity getSeverity() const { return Severity; }
96
97   /// Print using the given \p DP a user-friendly message.
98   /// This is the default message that will be printed to the user.
99   /// It is used when the frontend does not directly take advantage
100   /// of the information contained in fields of the subclasses.
101   /// The printed message must not end with '.' nor start with a severity
102   /// keyword.
103   virtual void print(DiagnosticPrinter &DP) const = 0;
104
105   static const char *AlwaysPrint;
106 };
107
108 typedef std::function<void(const DiagnosticInfo &)> DiagnosticHandlerFunction;
109
110 /// Diagnostic information for inline asm reporting.
111 /// This is basically a message and an optional location.
112 class DiagnosticInfoInlineAsm : public DiagnosticInfo {
113 private:
114   /// Optional line information. 0 if not set.
115   unsigned LocCookie;
116   /// Message to be reported.
117   const Twine &MsgStr;
118   /// Optional origin of the problem.
119   const Instruction *Instr;
120
121 public:
122   /// \p MsgStr is the message to be reported to the frontend.
123   /// This class does not copy \p MsgStr, therefore the reference must be valid
124   /// for the whole life time of the Diagnostic.
125   DiagnosticInfoInlineAsm(const Twine &MsgStr,
126                           DiagnosticSeverity Severity = DS_Error)
127       : DiagnosticInfo(DK_InlineAsm, Severity), LocCookie(0), MsgStr(MsgStr),
128         Instr(nullptr) {}
129
130   /// \p LocCookie if non-zero gives the line number for this report.
131   /// \p MsgStr gives the message.
132   /// This class does not copy \p MsgStr, therefore the reference must be valid
133   /// for the whole life time of the Diagnostic.
134   DiagnosticInfoInlineAsm(unsigned LocCookie, const Twine &MsgStr,
135                           DiagnosticSeverity Severity = DS_Error)
136       : DiagnosticInfo(DK_InlineAsm, Severity), LocCookie(LocCookie),
137         MsgStr(MsgStr), Instr(nullptr) {}
138
139   /// \p Instr gives the original instruction that triggered the diagnostic.
140   /// \p MsgStr gives the message.
141   /// This class does not copy \p MsgStr, therefore the reference must be valid
142   /// for the whole life time of the Diagnostic.
143   /// Same for \p I.
144   DiagnosticInfoInlineAsm(const Instruction &I, const Twine &MsgStr,
145                           DiagnosticSeverity Severity = DS_Error);
146
147   unsigned getLocCookie() const { return LocCookie; }
148   const Twine &getMsgStr() const { return MsgStr; }
149   const Instruction *getInstruction() const { return Instr; }
150
151   /// \see DiagnosticInfo::print.
152   void print(DiagnosticPrinter &DP) const override;
153
154   static bool classof(const DiagnosticInfo *DI) {
155     return DI->getKind() == DK_InlineAsm;
156   }
157 };
158
159 /// Diagnostic information for stack size reporting.
160 /// This is basically a function and a size.
161 class DiagnosticInfoStackSize : public DiagnosticInfo {
162 private:
163   /// The function that is concerned by this stack size diagnostic.
164   const Function &Fn;
165   /// The computed stack size.
166   unsigned StackSize;
167
168 public:
169   /// \p The function that is concerned by this stack size diagnostic.
170   /// \p The computed stack size.
171   DiagnosticInfoStackSize(const Function &Fn, unsigned StackSize,
172                           DiagnosticSeverity Severity = DS_Warning)
173       : DiagnosticInfo(DK_StackSize, Severity), Fn(Fn), StackSize(StackSize) {}
174
175   const Function &getFunction() const { return Fn; }
176   unsigned getStackSize() const { return StackSize; }
177
178   /// \see DiagnosticInfo::print.
179   void print(DiagnosticPrinter &DP) const override;
180
181   static bool classof(const DiagnosticInfo *DI) {
182     return DI->getKind() == DK_StackSize;
183   }
184 };
185
186 /// Diagnostic information for debug metadata version reporting.
187 /// This is basically a module and a version.
188 class DiagnosticInfoDebugMetadataVersion : public DiagnosticInfo {
189 private:
190   /// The module that is concerned by this debug metadata version diagnostic.
191   const Module &M;
192   /// The actual metadata version.
193   unsigned MetadataVersion;
194
195 public:
196   /// \p The module that is concerned by this debug metadata version diagnostic.
197   /// \p The actual metadata version.
198   DiagnosticInfoDebugMetadataVersion(const Module &M, unsigned MetadataVersion,
199                           DiagnosticSeverity Severity = DS_Warning)
200       : DiagnosticInfo(DK_DebugMetadataVersion, Severity), M(M),
201         MetadataVersion(MetadataVersion) {}
202
203   const Module &getModule() const { return M; }
204   unsigned getMetadataVersion() const { return MetadataVersion; }
205
206   /// \see DiagnosticInfo::print.
207   void print(DiagnosticPrinter &DP) const override;
208
209   static bool classof(const DiagnosticInfo *DI) {
210     return DI->getKind() == DK_DebugMetadataVersion;
211   }
212 };
213
214 /// Diagnostic information for the sample profiler.
215 class DiagnosticInfoSampleProfile : public DiagnosticInfo {
216 public:
217   DiagnosticInfoSampleProfile(StringRef FileName, unsigned LineNum,
218                               const Twine &Msg,
219                               DiagnosticSeverity Severity = DS_Error)
220       : DiagnosticInfo(DK_SampleProfile, Severity), FileName(FileName),
221         LineNum(LineNum), Msg(Msg) {}
222   DiagnosticInfoSampleProfile(StringRef FileName, const Twine &Msg,
223                               DiagnosticSeverity Severity = DS_Error)
224       : DiagnosticInfo(DK_SampleProfile, Severity), FileName(FileName),
225         LineNum(0), Msg(Msg) {}
226   DiagnosticInfoSampleProfile(const Twine &Msg,
227                               DiagnosticSeverity Severity = DS_Error)
228       : DiagnosticInfo(DK_SampleProfile, Severity), LineNum(0), Msg(Msg) {}
229
230   /// \see DiagnosticInfo::print.
231   void print(DiagnosticPrinter &DP) const override;
232
233   static bool classof(const DiagnosticInfo *DI) {
234     return DI->getKind() == DK_SampleProfile;
235   }
236
237   StringRef getFileName() const { return FileName; }
238   unsigned getLineNum() const { return LineNum; }
239   const Twine &getMsg() const { return Msg; }
240
241 private:
242   /// Name of the input file associated with this diagnostic.
243   StringRef FileName;
244
245   /// Line number where the diagnostic occurred. If 0, no line number will
246   /// be emitted in the message.
247   unsigned LineNum;
248
249   /// Message to report.
250   const Twine &Msg;
251 };
252
253 /// Common features for diagnostics dealing with optimization remarks.
254 class DiagnosticInfoOptimizationBase : public DiagnosticInfo {
255 public:
256   /// \p PassName is the name of the pass emitting this diagnostic.
257   /// \p Fn is the function where the diagnostic is being emitted. \p DLoc is
258   /// the location information to use in the diagnostic. If line table
259   /// information is available, the diagnostic will include the source code
260   /// location. \p Msg is the message to show. Note that this class does not
261   /// copy this message, so this reference must be valid for the whole life time
262   /// of the diagnostic.
263   DiagnosticInfoOptimizationBase(enum DiagnosticKind Kind,
264                                  enum DiagnosticSeverity Severity,
265                                  const char *PassName, const Function &Fn,
266                                  const DebugLoc &DLoc, const Twine &Msg)
267       : DiagnosticInfo(Kind, Severity), PassName(PassName), Fn(Fn), DLoc(DLoc),
268         Msg(Msg) {}
269
270   /// \see DiagnosticInfo::print.
271   void print(DiagnosticPrinter &DP) const override;
272
273   /// Return true if this optimization remark is enabled by one of
274   /// of the LLVM command line flags (-pass-remarks, -pass-remarks-missed,
275   /// or -pass-remarks-analysis). Note that this only handles the LLVM
276   /// flags. We cannot access Clang flags from here (they are handled
277   /// in BackendConsumer::OptimizationRemarkHandler).
278   virtual bool isEnabled() const = 0;
279
280   /// Return true if location information is available for this diagnostic.
281   bool isLocationAvailable() const;
282
283   /// Return a string with the location information for this diagnostic
284   /// in the format "file:line:col". If location information is not available,
285   /// it returns "<unknown>:0:0".
286   const std::string getLocationStr() const;
287
288   /// Return location information for this diagnostic in three parts:
289   /// the source file name, line number and column.
290   void getLocation(StringRef *Filename, unsigned *Line, unsigned *Column) const;
291
292   const char *getPassName() const { return PassName; }
293   const Function &getFunction() const { return Fn; }
294   const DebugLoc &getDebugLoc() const { return DLoc; }
295   const Twine &getMsg() const { return Msg; }
296
297 private:
298   /// Name of the pass that triggers this report. If this matches the
299   /// regular expression given in -Rpass=regexp, then the remark will
300   /// be emitted.
301   const char *PassName;
302
303   /// Function where this diagnostic is triggered.
304   const Function &Fn;
305
306   /// Debug location where this diagnostic is triggered.
307   DebugLoc DLoc;
308
309   /// Message to report.
310   const Twine &Msg;
311 };
312
313 /// Diagnostic information for applied optimization remarks.
314 class DiagnosticInfoOptimizationRemark : public DiagnosticInfoOptimizationBase {
315 public:
316   /// \p PassName is the name of the pass emitting this diagnostic. If
317   /// this name matches the regular expression given in -Rpass=, then the
318   /// diagnostic will be emitted. \p Fn is the function where the diagnostic
319   /// is being emitted. \p DLoc is the location information to use in the
320   /// diagnostic. If line table information is available, the diagnostic
321   /// will include the source code location. \p Msg is the message to show.
322   /// Note that this class does not copy this message, so this reference
323   /// must be valid for the whole life time of the diagnostic.
324   DiagnosticInfoOptimizationRemark(const char *PassName, const Function &Fn,
325                                    const DebugLoc &DLoc, const Twine &Msg)
326       : DiagnosticInfoOptimizationBase(DK_OptimizationRemark, DS_Remark,
327                                        PassName, Fn, DLoc, Msg) {}
328
329   static bool classof(const DiagnosticInfo *DI) {
330     return DI->getKind() == DK_OptimizationRemark;
331   }
332
333   /// \see DiagnosticInfoOptimizationBase::isEnabled.
334   bool isEnabled() const override;
335 };
336
337 /// Diagnostic information for missed-optimization remarks.
338 class DiagnosticInfoOptimizationRemarkMissed
339     : public DiagnosticInfoOptimizationBase {
340 public:
341   /// \p PassName is the name of the pass emitting this diagnostic. If
342   /// this name matches the regular expression given in -Rpass-missed=, then the
343   /// diagnostic will be emitted. \p Fn is the function where the diagnostic
344   /// is being emitted. \p DLoc is the location information to use in the
345   /// diagnostic. If line table information is available, the diagnostic
346   /// will include the source code location. \p Msg is the message to show.
347   /// Note that this class does not copy this message, so this reference
348   /// must be valid for the whole life time of the diagnostic.
349   DiagnosticInfoOptimizationRemarkMissed(const char *PassName,
350                                          const Function &Fn,
351                                          const DebugLoc &DLoc, const Twine &Msg)
352       : DiagnosticInfoOptimizationBase(DK_OptimizationRemarkMissed, DS_Remark,
353                                        PassName, Fn, DLoc, Msg) {}
354
355   static bool classof(const DiagnosticInfo *DI) {
356     return DI->getKind() == DK_OptimizationRemarkMissed;
357   }
358
359   /// \see DiagnosticInfoOptimizationBase::isEnabled.
360   bool isEnabled() const override;
361 };
362
363 /// Diagnostic information for optimization analysis remarks.
364 class DiagnosticInfoOptimizationRemarkAnalysis
365     : public DiagnosticInfoOptimizationBase {
366 public:
367   /// \p PassName is the name of the pass emitting this diagnostic. If
368   /// this name matches the regular expression given in -Rpass-analysis=, then
369   /// the diagnostic will be emitted. \p Fn is the function where the diagnostic
370   /// is being emitted. \p DLoc is the location information to use in the
371   /// diagnostic. If line table information is available, the diagnostic will
372   /// include the source code location. \p Msg is the message to show. Note that
373   /// this class does not copy this message, so this reference must be valid for
374   /// the whole life time of the diagnostic.
375   DiagnosticInfoOptimizationRemarkAnalysis(const char *PassName,
376                                            const Function &Fn,
377                                            const DebugLoc &DLoc,
378                                            const Twine &Msg)
379       : DiagnosticInfoOptimizationBase(DK_OptimizationRemarkAnalysis, DS_Remark,
380                                        PassName, Fn, DLoc, Msg) {}
381
382   static bool classof(const DiagnosticInfo *DI) {
383     return DI->getKind() == DK_OptimizationRemarkAnalysis;
384   }
385
386   /// \see DiagnosticInfoOptimizationBase::isEnabled.
387   bool isEnabled() const override;
388
389 protected:
390   DiagnosticInfoOptimizationRemarkAnalysis(enum DiagnosticKind Kind,
391                                            const char *PassName,
392                                            const Function &Fn,
393                                            const DebugLoc &DLoc,
394                                            const Twine &Msg)
395       : DiagnosticInfoOptimizationBase(Kind, DS_Remark, PassName, Fn, DLoc,
396                                        Msg) {}
397 };
398
399 /// Diagnostic information for optimization analysis remarks related to
400 /// floating-point non-commutativity.
401 class DiagnosticInfoOptimizationRemarkAnalysisFPCommute
402     : public DiagnosticInfoOptimizationRemarkAnalysis {
403 public:
404   /// \p PassName is the name of the pass emitting this diagnostic. If
405   /// this name matches the regular expression given in -Rpass-analysis=, then
406   /// the diagnostic will be emitted. \p Fn is the function where the diagnostic
407   /// is being emitted. \p DLoc is the location information to use in the
408   /// diagnostic. If line table information is available, the diagnostic will
409   /// include the source code location. \p Msg is the message to show. The
410   /// front-end will append its own message related to options that address
411   /// floating-point non-commutativity. Note that this class does not copy this
412   /// message, so this reference must be valid for the whole life time of the
413   /// diagnostic.
414   DiagnosticInfoOptimizationRemarkAnalysisFPCommute(const char *PassName,
415                                                     const Function &Fn,
416                                                     const DebugLoc &DLoc,
417                                                     const Twine &Msg)
418       : DiagnosticInfoOptimizationRemarkAnalysis(
419             DK_OptimizationRemarkAnalysisFPCommute, PassName, Fn, DLoc, Msg) {}
420
421   static bool classof(const DiagnosticInfo *DI) {
422     return DI->getKind() == DK_OptimizationRemarkAnalysisFPCommute;
423   }
424 };
425
426 /// Diagnostic information for optimization analysis remarks related to
427 /// pointer aliasing.
428 class DiagnosticInfoOptimizationRemarkAnalysisAliasing
429     : public DiagnosticInfoOptimizationRemarkAnalysis {
430 public:
431   /// \p PassName is the name of the pass emitting this diagnostic. If
432   /// this name matches the regular expression given in -Rpass-analysis=, then
433   /// the diagnostic will be emitted. \p Fn is the function where the diagnostic
434   /// is being emitted. \p DLoc is the location information to use in the
435   /// diagnostic. If line table information is available, the diagnostic will
436   /// include the source code location. \p Msg is the message to show. The
437   /// front-end will append its own message related to options that address
438   /// pointer aliasing legality. Note that this class does not copy this
439   /// message, so this reference must be valid for the whole life time of the
440   /// diagnostic.
441   DiagnosticInfoOptimizationRemarkAnalysisAliasing(const char *PassName,
442                                                    const Function &Fn,
443                                                    const DebugLoc &DLoc,
444                                                    const Twine &Msg)
445       : DiagnosticInfoOptimizationRemarkAnalysis(
446             DK_OptimizationRemarkAnalysisAliasing, PassName, Fn, DLoc, Msg) {}
447
448   static bool classof(const DiagnosticInfo *DI) {
449     return DI->getKind() == DK_OptimizationRemarkAnalysisAliasing;
450   }
451 };
452
453 /// Diagnostic information for machine IR parser.
454 class DiagnosticInfoMIRParser : public DiagnosticInfo {
455   const SMDiagnostic &Diagnostic;
456
457 public:
458   DiagnosticInfoMIRParser(DiagnosticSeverity Severity,
459                           const SMDiagnostic &Diagnostic)
460       : DiagnosticInfo(DK_MIRParser, Severity), Diagnostic(Diagnostic) {}
461
462   const SMDiagnostic &getDiagnostic() const { return Diagnostic; }
463
464   void print(DiagnosticPrinter &DP) const override;
465
466   static bool classof(const DiagnosticInfo *DI) {
467     return DI->getKind() == DK_MIRParser;
468   }
469 };
470
471 // Create wrappers for C Binding types (see CBindingWrapping.h).
472 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(DiagnosticInfo, LLVMDiagnosticInfoRef)
473
474 /// Emit an optimization-applied message. \p PassName is the name of the pass
475 /// emitting the message. If -Rpass= is given and \p PassName matches the
476 /// regular expression in -Rpass, then the remark will be emitted. \p Fn is
477 /// the function triggering the remark, \p DLoc is the debug location where
478 /// the diagnostic is generated. \p Msg is the message string to use.
479 void emitOptimizationRemark(LLVMContext &Ctx, const char *PassName,
480                             const Function &Fn, const DebugLoc &DLoc,
481                             const Twine &Msg);
482
483 /// Emit an optimization-missed message. \p PassName is the name of the
484 /// pass emitting the message. If -Rpass-missed= is given and \p PassName
485 /// matches the regular expression in -Rpass, then the remark will be
486 /// emitted. \p Fn is the function triggering the remark, \p DLoc is the
487 /// debug location where the diagnostic is generated. \p Msg is the
488 /// message string to use.
489 void emitOptimizationRemarkMissed(LLVMContext &Ctx, const char *PassName,
490                                   const Function &Fn, const DebugLoc &DLoc,
491                                   const Twine &Msg);
492
493 /// Emit an optimization analysis remark message. \p PassName is the name of
494 /// the pass emitting the message. If -Rpass-analysis= is given and \p
495 /// PassName matches the regular expression in -Rpass, then the remark will be
496 /// emitted. \p Fn is the function triggering the remark, \p DLoc is the debug
497 /// location where the diagnostic is generated. \p Msg is the message string
498 /// to use.
499 void emitOptimizationRemarkAnalysis(LLVMContext &Ctx, const char *PassName,
500                                     const Function &Fn, const DebugLoc &DLoc,
501                                     const Twine &Msg);
502
503 /// Emit an optimization analysis remark related to messages about
504 /// floating-point non-commutativity. \p PassName is the name of the pass
505 /// emitting the message. If -Rpass-analysis= is given and \p PassName matches
506 /// the regular expression in -Rpass, then the remark will be emitted. \p Fn is
507 /// the function triggering the remark, \p DLoc is the debug location where the
508 /// diagnostic is generated. \p Msg is the message string to use.
509 void emitOptimizationRemarkAnalysisFPCommute(LLVMContext &Ctx,
510                                              const char *PassName,
511                                              const Function &Fn,
512                                              const DebugLoc &DLoc,
513                                              const Twine &Msg);
514
515 /// Emit an optimization analysis remark related to messages about
516 /// pointer aliasing. \p PassName is the name of the pass emitting the message.
517 /// If -Rpass-analysis= is given and \p PassName matches the regular expression
518 /// in -Rpass, then the remark will be emitted. \p Fn is the function triggering
519 /// the remark, \p DLoc is the debug location where the diagnostic is generated.
520 /// \p Msg is the message string to use.
521 void emitOptimizationRemarkAnalysisAliasing(LLVMContext &Ctx,
522                                             const char *PassName,
523                                             const Function &Fn,
524                                             const DebugLoc &DLoc,
525                                             const Twine &Msg);
526
527 /// Diagnostic information for optimization failures.
528 class DiagnosticInfoOptimizationFailure
529     : public DiagnosticInfoOptimizationBase {
530 public:
531   /// \p Fn is the function where the diagnostic is being emitted. \p DLoc is
532   /// the location information to use in the diagnostic. If line table
533   /// information is available, the diagnostic will include the source code
534   /// location. \p Msg is the message to show. Note that this class does not
535   /// copy this message, so this reference must be valid for the whole life time
536   /// of the diagnostic.
537   DiagnosticInfoOptimizationFailure(const Function &Fn, const DebugLoc &DLoc,
538                                     const Twine &Msg)
539       : DiagnosticInfoOptimizationBase(DK_OptimizationFailure, DS_Warning,
540                                        nullptr, Fn, DLoc, Msg) {}
541
542   static bool classof(const DiagnosticInfo *DI) {
543     return DI->getKind() == DK_OptimizationFailure;
544   }
545
546   /// \see DiagnosticInfoOptimizationBase::isEnabled.
547   bool isEnabled() const override;
548 };
549
550 /// Emit a warning when loop vectorization is specified but fails. \p Fn is the
551 /// function triggering the warning, \p DLoc is the debug location where the
552 /// diagnostic is generated. \p Msg is the message string to use.
553 void emitLoopVectorizeWarning(LLVMContext &Ctx, const Function &Fn,
554                               const DebugLoc &DLoc, const Twine &Msg);
555
556 /// Emit a warning when loop interleaving is specified but fails. \p Fn is the
557 /// function triggering the warning, \p DLoc is the debug location where the
558 /// diagnostic is generated. \p Msg is the message string to use.
559 void emitLoopInterleaveWarning(LLVMContext &Ctx, const Function &Fn,
560                                const DebugLoc &DLoc, const Twine &Msg);
561
562 } // End namespace llvm
563
564 #endif