8#ifndef LLVM_TESTING_SUPPORT_ANNOTATIONS_H
9#define LLVM_TESTING_SUPPORT_ANNOTATIONS_H
62 return std::tie(L.Begin, L.End) == std::tie(R.Begin, R.End);
78 std::pair<size_t, llvm::StringRef>
84 std::vector<std::pair<size_t, llvm::StringRef>>
97 std::pair<Range, llvm::StringRef>
105 std::vector<std::pair<Range, llvm::StringRef>>
118 bool isPoint()
const {
return End == size_t(-1); }
122 std::vector<Annotation> All;
This file defines the StringMap class.
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
This file defines the SmallVector class.
Annotations lets you mark points and ranges inside source code, for tests:
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",...
StringRef - 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)
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)