Files
swift-mirror/include/swift/AST/DiagnosticsAll.def
Adam Nemet 9b9805420d Add optimization remarks
This allows reporting successful and unsuccessful optimizations similar to
clang/llvm.

This first patch adds support for the
options -Rpass=<pass-name-regex> -Rpass-missed=<pass-name-regex>.  These allow
reporting successful/unsuccessful optimization on the compiler output for passes
specified by the regex.  I've also added one missed and one passed remark type
to the inliner to test the infrastructure.

Clang also has the option of collecting these records in an external YAML data
file.  This will be added in a later patch.

A few notes:
* The goal is to use this facility for both user-lever "performance" warnings
and expert-level performance analysis.  There will probably be a flag in the
future differentiating the verbosity.

* The intent is match clang/llvm as much as it makes sense.  On the other hand I
did make some changes.  Unlike in llvm, the emitter is not a pass which
simplifies things.  Also the remark class hierarchy is greatly simplified since
we don't derive from DiagnosticInfo.  We also don't derive from Diagnostic to
support the streaming API for arbitrary named-value pairs.

* Currently function names are printed mangled which should be fixed.
2017-10-20 12:41:37 -07:00

62 lines
1.7 KiB
C++

//===--- DiagnosticsAll.def - Diagnostics Text Index ------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file imports all the other diagnostic files.
//
//===----------------------------------------------------------------------===//
#if !(defined(DIAG) || (defined(ERROR) && defined(WARNING) && defined(NOTE)))
# error Must define either DIAG or the set {ERROR,WARNING,NOTE}
#endif
#ifndef ERROR
# define ERROR(ID,Options,Text,Signature) \
DIAG(ERROR,ID,Options,Text,Signature)
#endif
#ifndef WARNING
# define WARNING(ID,Options,Text,Signature) \
DIAG(WARNING,ID,Options,Text,Signature)
#endif
#ifndef NOTE
# define NOTE(ID,Options,Text,Signature) \
DIAG(NOTE,ID,Options,Text,Signature)
#endif
#ifndef REMARK
# define REMARK(ID,Options,Text,Signature) \
DIAG(REMARK,ID,Options,Text,Signature)
#endif
#define DIAG_NO_UNDEF
#include "DiagnosticsCommon.def"
#include "DiagnosticsParse.def"
#include "DiagnosticsSema.def"
#include "DiagnosticsClangImporter.def"
#include "DiagnosticsSIL.def"
#include "DiagnosticsIRGen.def"
#include "DiagnosticsFrontend.def"
#include "DiagnosticsDriver.def"
#include "DiagnosticsRefactoring.def"
#undef DIAG_NO_UNDEF
#if defined(DIAG)
# undef DIAG
#endif
#undef NOTE
#undef WARNING
#undef ERROR
#undef REMARK