12 #ifndef MLIR_IR_LOCATIONDETAIL_H_ 13 #define MLIR_IR_LOCATIONDETAIL_H_ 18 #include "llvm/ADT/StringRef.h" 19 #include "llvm/Support/TrailingObjects.h" 27 : callee(callee), caller(caller) {}
30 using KeyTy = std::pair<Location, Location>;
48 : filename(filename), line(line), column(column) {}
51 using KeyTy = std::tuple<Identifier, unsigned, unsigned>;
53 return key ==
KeyTy(filename, line, column);
70 public llvm::TrailingObjects<FusedLocationStorage, Location> {
72 : numLocs(numLocs), metadata(metadata) {}
81 return key ==
KeyTy(getLocations(), metadata);
89 auto byteSize = totalSizeToAlloc<Location>(locs.size());
93 std::uninitialized_copy(locs.begin(), locs.end(),
94 result->getTrailingObjects<
Location>());
99 friend llvm::TrailingObjects<FusedLocationStorage, Location>;
111 : name(name), child(child) {}
114 using KeyTy = std::pair<Identifier, Location>;
131 : underlyingLocation(underlyingLocation), classId(classId),
132 fallbackLocation(fallbackLocation) {}
135 using KeyTy = std::tuple<uintptr_t, ClassID *, Location>;
137 return key ==
KeyTy(underlyingLocation, classId, fallbackLocation);
162 #endif // MLIR_IR_LOCATIONDETAIL_H_ Definition: InferTypeOpInterface.cpp:20
std::pair< Identifier, Location > KeyTy
The hash key used for uniquing.
Definition: LocationDetail.h:114
bool operator==(const KeyTy &key) const
Definition: LocationDetail.h:52
Location fallbackLocation
Definition: LocationDetail.h:156
Definition: STLExtras.h:95
static OpaqueLocationStorage * construct(AttributeStorageAllocator &allocator, const KeyTy &key)
Construct a new storage instance.
Definition: LocationDetail.h:141
std::pair< ArrayRef< Location >, Attribute > KeyTy
The hash key used for uniquing.
Definition: LocationDetail.h:79
Attribute metadata
Metadata used to reason about the generation of this fused location.
Definition: LocationDetail.h:106
Identifier filename
Definition: LocationDetail.h:64
Definition: StorageUniquer.h:89
Definition: LocationDetail.h:25
bool operator==(const KeyTy &key) const
Definition: LocationDetail.h:136
Definition: Identifier.h:26
FileLineColLocationStorage(Identifier filename, unsigned line, unsigned column)
Definition: LocationDetail.h:46
Definition: Location.h:52
bool operator==(const KeyTy &key) const
Definition: LocationDetail.h:115
Definition: LocationDetail.h:45
OpaqueLocationStorage(uintptr_t underlyingLocation, ClassID *classId, Location fallbackLocation)
Definition: LocationDetail.h:129
T * allocate()
Allocate an instance of the provided type.
Definition: StorageUniquer.h:109
Identifier name
Definition: LocationDetail.h:124
CallSiteLocationStorage(Location callee, Location caller)
Definition: LocationDetail.h:26
Location callee
Definition: LocationDetail.h:42
FusedLocationStorage(unsigned numLocs, Attribute metadata)
Definition: LocationDetail.h:71
Definition: Attributes.h:53
static CallSiteLocationStorage * construct(AttributeStorageAllocator &allocator, const KeyTy &key)
Construct a new storage instance.
Definition: LocationDetail.h:37
static FusedLocationStorage * construct(AttributeStorageAllocator &allocator, const KeyTy &key)
Construct a new storage instance.
Definition: LocationDetail.h:85
static FileLineColLocationStorage * construct(AttributeStorageAllocator &allocator, const KeyTy &key)
Construct a new storage instance.
Definition: LocationDetail.h:58
size_t numTrailingObjects(OverloadToken< Location >) const
Definition: LocationDetail.h:100
Definition: LocationDetail.h:109
std::pair< Location, Location > KeyTy
The hash key used for uniquing.
Definition: LocationDetail.h:30
std::tuple< uintptr_t, ClassID *, Location > KeyTy
The hash key used for uniquing.
Definition: LocationDetail.h:135
unsigned line
Definition: LocationDetail.h:65
Definition: LocationDetail.h:128
ClassID * classId
A unique pointer for each type of underlyingLocation.
Definition: LocationDetail.h:152
Definition: LocationDetail.h:68
bool operator==(const KeyTy &key) const
Definition: LocationDetail.h:80
Location caller
Definition: LocationDetail.h:42
NameLocationStorage(Identifier name, Location child)
Definition: LocationDetail.h:110
Definition: AttributeSupport.h:34
unsigned numLocs
Number of trailing location objects.
Definition: LocationDetail.h:103
ArrayRef< Location > getLocations() const
Definition: LocationDetail.h:74
uintptr_t underlyingLocation
Pointer to the corresponding object.
Definition: LocationDetail.h:149
static NameLocationStorage * construct(AttributeStorageAllocator &allocator, const KeyTy &key)
Construct a new storage instance.
Definition: LocationDetail.h:118
bool operator==(const KeyTy &key) const
Definition: LocationDetail.h:31
Location child
Definition: LocationDetail.h:125
std::tuple< Identifier, unsigned, unsigned > KeyTy
The hash key used for uniquing.
Definition: LocationDetail.h:51