llvm-project/clang/lib/InstallAPI/DiagnosticBuilderWrappers.h
Cyndy Ishida 823b1a5822
[clang-installapi] Store dylib attributes in the order they are passed on the command line. (#139087)
With the introduction of tbd-v5 holding rpaths, the order in which those
attributes are passed to `clang-installapi` must be represented in tbd
files. Previously, all dylib attributes were stored in a
non-deterministic `StringMap`. Instead, hold them in a custom collection
with an underlying vector to continue supporting searching by attribute.
This makes the order of all diagnostics related to load command
comparisons stable.

This approach resolves errors when building with reverse-iteration.
2025-05-08 21:15:10 -07:00

51 lines
2.0 KiB
C++

//===- DiagnosticBuilderWrappers.h -----------------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
/// Diagnostic wrappers for TextAPI types for error reporting.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_INSTALLAPI_DIAGNOSTICBUILDER_WRAPPER_H
#define LLVM_CLANG_INSTALLAPI_DIAGNOSTICBUILDER_WRAPPER_H
#include "clang/Basic/Diagnostic.h"
#include "clang/InstallAPI/DylibVerifier.h"
#include "llvm/TextAPI/Architecture.h"
#include "llvm/TextAPI/ArchitectureSet.h"
#include "llvm/TextAPI/InterfaceFile.h"
#include "llvm/TextAPI/Platform.h"
namespace llvm {
namespace MachO {
const clang::DiagnosticBuilder &operator<<(const clang::DiagnosticBuilder &DB,
const PlatformType &Platform);
const clang::DiagnosticBuilder &operator<<(const clang::DiagnosticBuilder &DB,
const PlatformVersionSet &Platforms);
const clang::DiagnosticBuilder &operator<<(const clang::DiagnosticBuilder &DB,
const Architecture &Arch);
const clang::DiagnosticBuilder &operator<<(const clang::DiagnosticBuilder &DB,
const ArchitectureSet &ArchSet);
const clang::DiagnosticBuilder &operator<<(const clang::DiagnosticBuilder &DB,
const FileType &Type);
const clang::DiagnosticBuilder &operator<<(const clang::DiagnosticBuilder &DB,
const PackedVersion &Version);
const clang::DiagnosticBuilder &
operator<<(const clang::DiagnosticBuilder &DB,
const clang::installapi::LibAttrs::Entry &LibAttr);
} // namespace MachO
} // namespace llvm
#endif // LLVM_CLANG_INSTALLAPI_DIAGNOSTICBUILDER_WRAPPER_H