clang 22.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 <string>
14
15namespace clang::ssaf {
16
17/// Uniquely identifies an analysis summary.
18///
19/// This is the key to refer to an analysis or to name a builder to build an
20/// analysis.
22public:
23 explicit SummaryName(std::string Name) : Name(std::move(Name)) {}
24
25 bool operator==(const SummaryName &Other) const { return Name == Other.Name; }
26 bool operator!=(const SummaryName &Other) const { return !(*this == Other); }
27 bool operator<(const SummaryName &Other) const { return Name < Other.Name; }
28
29 /// Explicit conversion to the underlying string representation.
30 llvm::StringRef str() const { return Name; }
31
32private:
33 std::string Name;
34};
35
36} // namespace clang::ssaf
37
38#endif // LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_SUMMARYNAME_H
bool operator<(const SummaryName &Other) const
Definition SummaryName.h:27
bool operator!=(const SummaryName &Other) const
Definition SummaryName.h:26
SummaryName(std::string Name)
Definition SummaryName.h:23
llvm::StringRef str() const
Explicit conversion to the underlying string representation.
Definition SummaryName.h:30
bool operator==(const SummaryName &Other) const
Definition SummaryName.h:25
@ Other
Other implicit parameter.
Definition Decl.h:1746