clang 23.0.0git
AnalysisName.h
Go to the documentation of this file.
1//===- AnalysisName.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// Strong typedef identifying a whole-program analysis and its result type.
10// Distinct from SummaryName, which identifies per-entity EntitySummary types.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_WHOLEPROGRAMANALYSIS_ANALYSISNAME_H
15#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_WHOLEPROGRAMANALYSIS_ANALYSISNAME_H
16
17#include "llvm/ADT/StringRef.h"
18#include "llvm/Support/raw_ostream.h"
19#include <string>
20
21namespace clang::ssaf {
22
23/// Uniquely identifies a whole-program analysis and the AnalysisResult it
24/// produces. Used as the key in WPASuite and AnalysisRegistry.
25///
26/// Distinct from SummaryName, which is used by EntitySummary types for routing
27/// through the LUSummary.
29public:
30 explicit AnalysisName(std::string Name) : Name(std::move(Name)) {}
31
32 bool operator==(const AnalysisName &Other) const {
33 return Name == Other.Name;
34 }
35 bool operator!=(const AnalysisName &Other) const { return !(*this == Other); }
36 bool operator<(const AnalysisName &Other) const { return Name < Other.Name; }
37
38 /// Explicit conversion to the underlying string representation.
39 llvm::StringRef str() const { return Name; }
40
41private:
42 std::string Name;
43};
44
45llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const AnalysisName &AN);
46
47} // namespace clang::ssaf
48
49#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_WHOLEPROGRAMANALYSIS_ANALYSISNAME_H
AnalysisName(std::string Name)
llvm::StringRef str() const
Explicit conversion to the underlying string representation.
bool operator==(const AnalysisName &Other) const
bool operator!=(const AnalysisName &Other) const
bool operator<(const AnalysisName &Other) const
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, BuildNamespaceKind BNK)
@ Other
Other implicit parameter.
Definition Decl.h:1761