~ubuntu-branches/ubuntu/trusty/llvm-toolchain-snapshot/trusty-201310232150

« back to all changes in this revision

Viewing changes to clang/include/clang/Basic/Diagnostic.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-27 15:01:57 UTC
  • mfrom: (0.10.1) (0.9.1) (0.8.1) (0.7.1) (0.6.1) (0.5.2)
  • Revision ID: package-import@ubuntu.com-20130527150157-tdkrsjpuvht7v0qx
Tags: 1:3.4~svn182733-1~exp1
* New snapshot release (3.4 release)
* Add a symlink of libLLVM-3.4.so.1 to usr/lib/llvm-3.4/lib/libLLVM-3.4.so
    to fix make the llvm-config-3.4 --libdir work (Closes: #708677)
  * Various packages rename to allow co installations:
    * libclang1 => libclang1-3.4
    * libclang1-dbg => libclang1-3.4-dbg
    * libclang-dev => libclang-3.4-dev
    * libclang-common-dev => libclang-common-3.4-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
  bool SuppressAllDiagnostics;   // Suppress all diagnostics.
176
176
  bool ElideType;                // Elide common types of templates.
177
177
  bool PrintTemplateTree;        // Print a tree when comparing templates.
178
 
  bool WarnOnSpellCheck;         // Emit warning when spellcheck is initiated.
179
178
  bool ShowColors;               // Color printing is enabled.
180
179
  OverloadsShown ShowOverloads;  // Which overload candidates to show.
181
180
  unsigned ErrorLimit;           // Cap of # errors emitted, 0 -> no limit.
467
466
  /// tree format.
468
467
  void setPrintTemplateTree(bool Val = false) { PrintTemplateTree = Val; }
469
468
  bool getPrintTemplateTree() { return PrintTemplateTree; }
470
 
 
471
 
  /// \brief Warn when spellchecking is initated, for testing.
472
 
  void setWarnOnSpellCheck(bool Val = false) { WarnOnSpellCheck = Val; }
473
 
  bool getWarnOnSpellCheck() { return WarnOnSpellCheck; }
474
469
 
475
470
  /// \brief Set color printing, so the type diffing will inject color markers
476
471
  /// into the output.
1217
1212
  ~StoredDiagnostic();
1218
1213
 
1219
1214
  /// \brief Evaluates true when this object stores a diagnostic.
1220
 
  operator bool() const { return Message.size() > 0; }
 
1215
  LLVM_EXPLICIT operator bool() const { return Message.size() > 0; }
1221
1216
 
1222
1217
  unsigned getID() const { return ID; }
1223
1218
  DiagnosticsEngine::Level getLevel() const { return Level; }
1301
1296
  /// warnings and errors.
1302
1297
  virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
1303
1298
                                const Diagnostic &Info);
1304
 
  
1305
 
  /// \brief Clone the diagnostic consumer, producing an equivalent consumer
1306
 
  /// that can be used in a different context.
1307
 
  virtual DiagnosticConsumer *clone(DiagnosticsEngine &Diags) const = 0;
1308
1299
};
1309
1300
 
1310
1301
/// \brief A diagnostic client that ignores all diagnostics.
1314
1305
                        const Diagnostic &Info) {
1315
1306
    // Just ignore it.
1316
1307
  }
1317
 
  DiagnosticConsumer *clone(DiagnosticsEngine &Diags) const {
1318
 
    return new IgnoringDiagConsumer();
1319
 
  }
 
1308
};
 
1309
 
 
1310
/// \brief Diagnostic consumer that forwards diagnostics along to an
 
1311
/// existing, already-initialized diagnostic consumer.
 
1312
///
 
1313
class ForwardingDiagnosticConsumer : public DiagnosticConsumer {
 
1314
  DiagnosticConsumer &Target;
 
1315
 
 
1316
public:
 
1317
  ForwardingDiagnosticConsumer(DiagnosticConsumer &Target) : Target(Target) {}
 
1318
 
 
1319
  virtual ~ForwardingDiagnosticConsumer();
 
1320
 
 
1321
  virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
 
1322
                                const Diagnostic &Info);
 
1323
  virtual void clear();
 
1324
 
 
1325
  virtual bool IncludeInDiagnosticCounts() const;
1320
1326
};
1321
1327
 
1322
1328
// Struct used for sending info about how a type should be printed.