diff options
Diffstat (limited to 'include/llvm/IR/LLVMContext.h')
-rw-r--r-- | include/llvm/IR/LLVMContext.h | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/include/llvm/IR/LLVMContext.h b/include/llvm/IR/LLVMContext.h index bd7097b39a3e..c80504500418 100644 --- a/include/llvm/IR/LLVMContext.h +++ b/include/llvm/IR/LLVMContext.h @@ -1,9 +1,8 @@ //===- llvm/LLVMContext.h - Class for managing "global" state ---*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -36,12 +35,8 @@ template <typename T> class SmallVectorImpl; class SMDiagnostic; class StringRef; class Twine; - -namespace yaml { - -class Output; - -} // end namespace yaml +class RemarkStreamer; +class raw_ostream; namespace SyncScope { @@ -103,6 +98,8 @@ public: MD_callees = 23, // "callees" MD_irr_loop = 24, // "irr_loop" MD_access_group = 25, // "llvm.access.group" + MD_callback = 26, // "callback" + MD_preserve_access_index = 27, // "llvm.preserve.*.access.index" }; /// Known operand bundle tag IDs, which always have the same value. All @@ -246,16 +243,23 @@ public: /// included in optimization diagnostics. void setDiagnosticsHotnessThreshold(uint64_t Threshold); - /// Return the YAML file used by the backend to save optimization - /// diagnostics. If null, diagnostics are not saved in a file but only - /// emitted via the diagnostic handler. - yaml::Output *getDiagnosticsOutputFile(); - /// Set the diagnostics output file used for optimization diagnostics. + /// Return the streamer used by the backend to save remark diagnostics. If it + /// does not exist, diagnostics are not saved in a file but only emitted via + /// the diagnostic handler. + RemarkStreamer *getRemarkStreamer(); + const RemarkStreamer *getRemarkStreamer() const; + + /// Set the diagnostics output used for optimization diagnostics. + /// This filename may be embedded in a section for tools to find the + /// diagnostics whenever they're needed. + /// + /// If a remark streamer is already set, it will be replaced with + /// \p RemarkStreamer. /// - /// By default or if invoked with null, diagnostics are not saved in a file - /// but only emitted via the diagnostic handler. Even if an output file is - /// set, the handler is invoked for each diagnostic message. - void setDiagnosticsOutputFile(std::unique_ptr<yaml::Output> F); + /// By default, diagnostics are not saved in a file but only emitted via the + /// diagnostic handler. Even if an output file is set, the handler is invoked + /// for each diagnostic message. + void setRemarkStreamer(std::unique_ptr<RemarkStreamer> RemarkStreamer); /// Get the prefix that should be printed in front of a diagnostic of /// the given \p Severity |