8#ifndef LLVM_TESTING_SUPPORT_ANNOTATIONS_H
9#define LLVM_TESTING_SUPPORT_ANNOTATIONS_H
76 return std::tie(L.Begin, L.End) == std::tie(R.Begin, R.End);
121 std::pair<size_t, llvm::StringRef>
127 std::vector<std::pair<size_t, llvm::StringRef>>
140 std::pair<Range, llvm::StringRef>
148 std::vector<std::pair<Range, llvm::StringRef>>
161 bool isPoint()
const {
return End ==
size_t(-1); }
165 std::vector<Annotation> All;
167 llvm::StringMap<llvm::SmallVector<size_t, 1>> Points;
168 llvm::StringMap<llvm::SmallVector<size_t, 1>> Ranges;
This file defines the StringMap class.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
This file defines the SmallVector class.
Annotations(llvm::StringRef Text)
Parses the annotations from Text. Crashes if it's malformed.
std::vector< std::pair< size_t, llvm::StringRef > > pointsWithPayload(llvm::StringRef Name="") const
Returns the positions and payloads (if any) of all points named Name.
Range range(llvm::StringRef Name="") const
Returns the location of the range marked by [[ ]] (or $name[[ ]]).
size_t point(llvm::StringRef Name="") const
Returns the position of the point marked by ^ (or $name^) in the text.
std::pair< size_t, llvm::StringRef > pointWithPayload(llvm::StringRef Name="") const
Returns the position of the point with Name and its payload (if any).
llvm::StringMap< llvm::SmallVector< size_t, 1 > > all_points() const
Returns the mapping of all names of points marked in the text to their position.
std::pair< Range, llvm::StringRef > rangeWithPayload(llvm::StringRef Name="") const
Returns the location and payload of the range marked by [[ ]] (or $name(payload)[[ ]]).
std::vector< Range > ranges(llvm::StringRef Name="") const
Returns the location of all ranges marked by [[ ]] (or $name[[ ]]).
std::vector< std::pair< Range, llvm::StringRef > > rangesWithPayload(llvm::StringRef Name="") const
Returns the location of all ranges marked by [[ ]] (or $name(payload)[[ ]]).
llvm::StringMap< llvm::SmallVector< Range, 1 > > all_ranges() const
Returns the mapping of all names of ranges marked in the text to their location.
std::vector< size_t > points(llvm::StringRef Name="") const
Returns the position of all points marked by ^ (or $name^) in the text.
llvm::StringRef code() const
The input text with all annotations stripped.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Markers used to denote points, names/payloads and ranges in the annotated text.
Markers & setPoint(llvm::StringRef P)
Markers & setName(llvm::StringRef N)
Markers & setRangeEnd(llvm::StringRef E)
llvm::StringRef RangeBegin
Markers & setRangeBegin(llvm::StringRef B)
Two offsets pointing to a continuous substring.
friend bool operator==(const Range &L, const Range &R)
friend bool operator!=(const Range &L, const Range &R)