clang 23.0.0git
SummaryName.h
Go to the documentation of this file.
1//===- SummaryName.h --------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_SUMMARYNAME_H
10#define LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_SUMMARYNAME_H
11
12#include "llvm/ADT/StringRef.h"
13#include "llvm/Support/raw_ostream.h"
14#include <string>
15
16namespace clang::ssaf {
17
18/// Uniquely identifies an analysis summary.
19///
20/// This is the key to refer to an analysis or to name a builder to build an
21/// analysis.
23public:
24 explicit SummaryName(std::string Name) : Name(std::move(Name)) {}
25
26 bool operator==(const SummaryName &Other) const { return Name == Other.Name; }
27 bool operator!=(const SummaryName &Other) const { return !(*this == Other); }
28 bool operator<(const SummaryName &Other) const { return Name < Other.Name; }
29
30 /// Explicit conversion to the underlying string representation.
31 llvm::StringRef str() const { return Name; }
32
33private:
34 std::string Name;
35 friend class TestFixture;
36};
37
38llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const SummaryName &SN);
39} // namespace clang::ssaf
40
41#endif // LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_SUMMARYNAME_H
Uniquely identifies an analysis summary.
Definition SummaryName.h:22
bool operator<(const SummaryName &Other) const
Definition SummaryName.h:28
bool operator!=(const SummaryName &Other) const
Definition SummaryName.h:27
SummaryName(std::string Name)
Definition SummaryName.h:24
llvm::StringRef str() const
Explicit conversion to the underlying string representation.
Definition SummaryName.h:31
bool operator==(const SummaryName &Other) const
Definition SummaryName.h:26
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, BuildNamespaceKind BNK)
@ Other
Other implicit parameter.
Definition Decl.h:1746