LLVM 24.0.0git
FunctionLocalMetadata.h
Go to the documentation of this file.
1//===- FunctionLocalMetadata.h - Function-Local Metadata Info ---*- 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// This file contains definitions for the function-local metadata types and the
10// MDFunctionLocalContext class which stores them.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_IR_FUNCTIONLOCALMETADATA_H
15#define LLVM_IR_FUNCTIONLOCALMETADATA_H
16
17#include "llvm/ADT/DenseMap.h"
18#include "llvm/ADT/STLExtras.h"
21#include "llvm/IR/Metadata.h"
22#include <optional>
23
24namespace llvm {
25
26class DILocalScope;
29
30struct FLScope;
31struct FLSrcLoc;
32struct FLInlinedCall;
33
34namespace detail {
35template <typename T> struct HasFLIndex {};
36template <> struct HasFLIndex<FLScope> {
38};
39template <> struct HasFLIndex<FLSrcLoc> {
41};
42template <> struct HasFLIndex<FLInlinedCall> {
44};
45} // namespace detail
46
47/// Small wrapper class for an FLMD index, which may be "no index".
48/// Should be checked to see if value is present before using, otherwise the
49/// implicit/explicit index value will be invalid.
50/// Internally uses 0 as the "no index" value, and stores the internal index
51/// value as the actual index + 1, subtracting to get the real index.
52template <typename IndexedType> class FLIndex {
53public:
55
56private:
57 friend struct DenseMapInfo<FLIndex<IndexedType>>;
58 IndexType Index;
59
60public:
61 FLIndex() : Index(0) {}
62 FLIndex(std::nullopt_t) : Index(0) {}
63 FLIndex(IndexType InIndex) : Index(InIndex + 1) {
64 assert(InIndex < std::numeric_limits<IndexType>::max() &&
65 "Hit maximum index limit!");
66 }
67 operator bool() const { return Index; }
68 IndexType get() const { return Index - 1; }
69 bool operator==(const FLIndex &Other) const { return Index == Other.Index; }
70 bool operator!=(const FLIndex &Other) const { return Index != Other.Index; }
71
72 IndexType asRaw() const { return Index; }
73 static FLIndex fromRaw(IndexType RawIndex) {
74 FLIndex Index;
75 Index.Index = RawIndex;
76 return Index;
77 }
78
79 friend inline hash_code hash_value(const FLIndex<IndexedType> &Idx) {
80 return hash_value(Idx.asRaw());
81 }
82};
83
84template <typename IndexedType> struct DenseMapInfo<FLIndex<IndexedType>> {
86 return hash_value(DL.asRaw());
87 }
88
90 return LHS == RHS;
91 }
92};
93
95 // The FLDebugLoc class, where the atom group numbers are used, has only 13
96 // bits to store AtomGroup - thus there is currently no point in holding
97 // MaxAtomGroup numbers larger than 13 bits.
98 constexpr static uint16_t MaxAllowedAtomGroup = (1 << 13) - 1;
101 // Transient field used to track the largest atom in this inlined call context
102 // for the purpose of generating new atom groups.
103 // NB: We keep the MaxAtomGroup field at 15 bits for padding purposes, but it
104 // is capped at 13 bits (see MaxAllowedAtomGroup above); In future we may
105 // reclaim these bits for some other purpose.
109 FLInlinedCall() = default;
121 // TODO: This assert exists more for testing purposes, to determine whether
122 // this is a limit we actually hit or not. If we hit this frequently, we may
123 // need to consider a fix; if we do relax this assert, then we'll need to
124 // also relax the assert in mapAtomInstance that new atom groups are
125 // strictly greater than old.
126 // Suitable fixes include either refusing further atom groups by always
127 // returning 0 once the limit is reached, or wrapping back around to 1
128 // (which is very unlikely to cause any meaningful collisions).
129 assert(MaxAtomGroup < MaxAllowedAtomGroup && "Atom group limit reached!");
130 return ++MaxAtomGroup;
131 }
132 // Equality check that ignores MaxAtomGroup, which is a transient field - it
133 // is not serialized, and may be modified in-place.
134 bool isEquivalent(const FLInlinedCall &Other) const {
135 return SrcLocIdx == Other.SrcLocIdx && InlinedAtIdx == Other.InlinedAtIdx &&
136 Uniquable == Other.Uniquable &&
137 InlineeContext == Other.InlineeContext;
138 }
139 /// Returns true if the location of this FLInlinedCall is inlined.
140 bool isInlined() const { return InlinedAtIdx; }
141 /// Returns the FLInlinedCall that this call was inlined at; only valid if
142 /// isInlined().
144
145 // Ignores MaxAtomGroup - as a transient field, we do not want to use it as
146 // part of a map key.
147 friend inline hash_code hash_value(const FLInlinedCall &IC) {
149 IC.InlineeContext);
150 }
151 LLVM_ABI void print(raw_ostream &OS, const Module *M = nullptr) const;
153 const Module *M = nullptr) const;
154};
155template <> struct DenseMapInfo<FLInlinedCall> {
156 static unsigned getHashValue(FLInlinedCall IC) { return hash_value(IC); }
157
159 return LHS.isEquivalent(RHS);
160 }
161};
162
163/// Unique FLMD.
164/// Stores source location information.
165struct FLSrcLoc {
169 FLSrcLoc() = default;
172 assert(ScopeIdx && "SrcLoc needs valid scope!");
173 }
175 static_assert(sizeof(*this) == sizeof(uint64_t));
176 uint64_t Result;
177 std::memcpy(&Result, this, sizeof(Result));
178 return Result;
179 }
180 bool operator==(const FLSrcLoc &Other) const {
181 return asRawInt() == Other.asRawInt();
182 }
183 friend inline hash_code hash_value(const FLSrcLoc &SrcLoc) {
184 return hash_value(SrcLoc.asRawInt());
185 }
186 LLVM_ABI void print(raw_ostream &OS, const Module *M = nullptr) const;
188 const Module *M = nullptr) const;
189};
190template <> struct DenseMapInfo<FLSrcLoc> {
191 static unsigned getHashValue(FLSrcLoc SrcLoc) { return hash_value(SrcLoc); }
192
193 static bool isEqual(FLSrcLoc LHS, FLSrcLoc RHS) { return LHS == RHS; }
194};
195
196/// Unique FLMD, just a wrapper around a DILocalScope.
197struct FLScope {
199 FLScope() = default;
201 operator DILocalScope *() { return Scope; }
202 DILocalScope *get() { return Scope; }
203 operator const DILocalScope *() const { return Scope; }
204 const DILocalScope *get() const { return Scope; }
205 bool operator==(const FLScope &Other) const { return Scope == Other.Scope; }
206 friend inline hash_code hash_value(const FLScope &Scope) {
207 return hash_value(Scope.Scope);
208 }
209 LLVM_ABI void print(raw_ostream &OS, const Module *M = nullptr) const;
211 const Module *M = nullptr) const;
212};
213template <> struct DenseMapInfo<FLScope> {
214 static unsigned getHashValue(FLScope Scope) { return hash_value(Scope); }
215
216 static bool isEqual(FLScope LHS, FLScope RHS) { return LHS == RHS; }
217};
218
219/// Storage class for function-local metadata objects.
220/// This is a special MDNode variation: the class benefits from being able to
221/// appear as an operand in other MDNodes, to be treated as a metadata
222/// attachment to functions, and from the generic MDNode enumeration logic.
223/// However, it holds MDNode references that are not part of the MDNode
224/// operands() array and are not tracking references (meaning it contains
225/// forward references that must be resolved separately from the generic MDNode
226/// tracking/resolution facilities), does not meaningfully support cloning, and
227/// can only ever be created as `distinct`, not unique or temporary.
228/// To access all MDNodes referenced from this context, use the
229/// `getUsedMDNodes()` function.
230class MDFunctionLocalContext : public MDNode {
231 MDFunctionLocalContext(LLVMContext &C, StorageType Storage, bool NonDebug)
232 : MDNode(C, MDFunctionLocalContextKind, Storage, {}) {
233 // NonDebug: Identifies this context as belonging to a function without
234 // debug information; see `isNonDebug()` below for more details.
235 setNonDebug(NonDebug);
236 // MaxAtomGroup: Transient/non-serialized field, starts at 0 and mutates
237 // in-place.
238 SubclassData16 = 0;
239 }
240 ~MDFunctionLocalContext() = default;
241
245
246 // Should generally only be used for deferred construction of an
247 // MDFunctionLocalContext, i.e. when we want to construct an instance before
248 // we know whether or not it is a NonDebug context, which may be important (or
249 // at least convenient) for tracking forward references.
250 void setNonDebug(bool IsNonDebug) { SubclassData1 = IsNonDebug; }
251
252public:
253 friend class LLVMContextImpl;
254 friend class MDNode;
255 friend class LLParser;
256 constexpr static uint16_t MaxAllowedAtomGroup =
258
259 static bool classof(const Metadata *MD) {
260 return MD->getMetadataID() == MDFunctionLocalContextKind;
261 }
262
263 // Populates \p Nodes with the complete set of MDNodes used by this.
265
267 bool NonDebug = false);
268 TempMDFunctionLocalContext clone() const { return cloneImpl(); }
269 TempMDFunctionLocalContext cloneImpl() const {
270 llvm_unreachable("Clone unsupported for MDFunctionLocalContext.");
271 return nullptr;
272 }
273
274 // If this is true, then this is a special FLContext, used for a function
275 // without debug info to store inlined call information. This FLContext
276 // contains no Scopes and no SrcLocs, meaning it is never valid to create a
277 // non-inlined debug loc within it.
278 // Nested InlinedCalls are copied during inlining as normal, and the resulting
279 // InlinedCall for the inlining operation has no SrcLoc and no InlinedAt; this
280 // requires some special handling for functions like "getInlinedAtLocation"
281 // that explicitly traverse the InlinedAt chain. If this function is then
282 // inlined into a debug function, the location-less InlinedCall is overwritten
283 // instead of transferred.
284 // NB: Hopefully this design doesn't raise many problems as-is, because in
285 // general we only care about debug locs inlined into a nodebug function when
286 // they are inlined again into a debug function - otherwise they are generally
287 // ignored. If this leads to problems, then we need a more sophisticated
288 // solution.
289 bool isNonDebug() const { return SubclassData1; }
290
291 ArrayRef<FLScope> getScopes() const { return Scopes; }
292 ArrayRef<FLSrcLoc> getSrcLocs() const { return SrcLocs; }
293 ArrayRef<FLInlinedCall> getInlinedCalls() const { return InlinedCalls; }
294
296 assert(Idx && "Attempted to fetch a Scope with an empty index!");
297 return Scopes[Idx.get()];
298 }
300 FLIndex<FLInlinedCall> InlinedAt) const {
301 assert(Idx && "Attempted to fetch a Scope with an empty index!");
302 if (!InlinedAt)
303 return Scopes[Idx.get()];
304 return InlinedCalls[InlinedAt.get()].getInlinee()->getScope(Idx);
305 }
307 assert(Idx && "Attempted to fetch a SrcLoc with an empty index!");
308 return SrcLocs[Idx.get()];
309 }
311 FLIndex<FLInlinedCall> InlinedAt) const {
312 assert(Idx && "Attempted to fetch a SrcLoc with an empty index!");
313 if (!InlinedAt)
314 return SrcLocs[Idx.get()];
315 return InlinedCalls[InlinedAt.get()].getInlinee()->getSrcLoc(Idx);
316 }
318 assert(Idx && "Attempted to fetch an InlinedCall with an empty index!");
319 return InlinedCalls[Idx.get()];
320 }
321
323 /// Generally this shouldn't be called directly; prefer
324 /// updateAtomGroupWaterline, including any relevant InlinedAt.
325 /// TODO: Should this be private?
326 void setMaxAtomGroup(uint16_t NewAtomGroup) { SubclassData16 = NewAtomGroup; }
327
329 if (!InlinedCallIdx) {
330 // NB: See comment in FLInlinedCall::getNewAtomGroup.
332 "Atom group limit reached!");
334 return getMaxAtomGroup();
335 }
336 return InlinedCalls[InlinedCallIdx.get()].getNewAtomGroup();
337 }
339 uint16_t NewWaterline) {
340 assert(NewWaterline <= MaxAllowedAtomGroup &&
341 "New atom group exceeds limit!");
342 if (!InlinedCallIdx)
343 setMaxAtomGroup(std::max(getMaxAtomGroup(), NewWaterline));
344 else
345 InlinedCalls[InlinedCallIdx.get()].MaxAtomGroup = std::max(
346 InlinedCalls[InlinedCallIdx.get()].MaxAtomGroup, NewWaterline);
347 }
349 if (!InlinedCallIdx)
350 return getMaxAtomGroup();
351 return InlinedCalls[InlinedCallIdx.get()].MaxAtomGroup;
352 }
353
354 /// Inserts a new FLScope \p Scope and returns its index.
356 Scopes.push_back(Scope);
357 return Scopes.size() - 1;
358 }
359 /// Returns the existing index of \p Scope, or else inserts it and returns its
360 /// new index.
361 /// NB: Uses linear search, which is very inefficient, but required if we
362 /// may be inserting a duplicate Scope; if performing this operation
363 /// repeatedly, FLMDBuilder is significantly more efficient.
365 for (uint16_t Idx = 0; Idx < Scopes.size(); ++Idx)
366 if (Scopes[Idx] == Scope)
367 return Idx;
368 return insertScope(Scope);
369 }
370
371 /// Inserts a new FLSrcLoc \p SrcLoc and returns its index.
373 SrcLocs.push_back(SrcLoc);
374 return SrcLocs.size() - 1;
375 }
376 /// Returns the existing index of \p SrcLoc, or else inserts it and returns
377 /// its new index.
378 /// NB: Uses linear search, which is very inefficient, but required if we
379 /// may be inserting a duplicate SrcLoc; if performing this operation
380 /// repeatedly, FLMDBuilder is significantly more efficient.
381 /// An exception to this is if inserting a SrcLoc with DISubprogram scope,
382 /// column=0, and line equal to either 0, SP->getLine(), or
383 /// SP->getScopeLine(); these are inserted near the front of SrcLocs by
384 /// FLMDBuilder, so can generally be retrieved quickly.
386 for (uint32_t Idx = 0; Idx < SrcLocs.size(); ++Idx)
387 if (SrcLocs[Idx] == SrcLoc)
388 return Idx;
389 return insertSrcLoc(SrcLoc);
390 }
391
392 /// Returns the existing index of a uniquable \p InlinedCall, or else inserts
393 /// it and returns its new index.
394 /// NB: Uses linear search for uniquing, which is very inefficient; pass
395 /// \p UniquableMayExist as false if passing an InlinedCall which is uniquable
396 /// but is known to not already exist.
398 bool UniquableMayExist = true) {
399 if (InlinedCall.Uniquable && UniquableMayExist) {
400 for (uint16_t Idx = 0; Idx < InlinedCalls.size(); ++Idx) {
401 if (InlinedCall.isEquivalent(InlinedCalls[Idx])) {
402 InlinedCalls[Idx].MaxAtomGroup = std::max(
403 InlinedCall.MaxAtomGroup, InlinedCalls[Idx].MaxAtomGroup);
404 return FLIndex<FLInlinedCall>(Idx);
405 }
406 }
407 }
408 InlinedCalls.push_back(InlinedCall);
409 return InlinedCalls.size() - 1;
410 }
411
412 /// Prints a shortened version of this FLContext, where only the number of
413 /// entries in each storage array is printed; useful when the full contents
414 /// are not needed.
415 LLVM_ABI void printShort(raw_ostream &OS, const Module *M = nullptr) const;
417 const Module *M = nullptr) const;
418};
419
420inline FLInlinedCall
422 assert(isInlined() && "getInlinedAt requires the location of this "
423 "FLInlinedCall to be inlined!");
424 return FLCtx->getInlinedCall(InlinedAtIdx);
425}
426
427/// Builder class used to more efficiently insert new entries into an
428/// MDFunctionLocalContext, using maps to perform uniquing instead of linear
429/// search.
430/// If inserting into an empty MDFunctionLocalContext, also performs initial
431/// insertions of the DISubprogram, and of SrcLocs for
432/// Line={0, SP->getLine(), SP->getScopeLine()} at top-level scope, as these are
433/// likely to be requested by optimizations later on.
435 MDFunctionLocalContext *FLContext;
438
439public:
440 // Returns the index for a Scope with the given arguments, either returning
441 // the index of an existing copy or inserting a new entry and returning its
442 // index.
444 FLScope InsertedScope(const_cast<DILocalScope *>(Scope));
445 auto [ScopeIt, Inserted] = ScopeMap.try_emplace(InsertedScope);
446 if (Inserted)
447 ScopeIt->second = FLContext->insertScope(InsertedScope);
448 return ScopeIt->second;
449 }
450 // Returns the index for a SrcLoc with the given arguments, either returning
451 // the index of an existing copy or inserting a new entry and returning its
452 // index.
454 FLIndex<FLScope> ScopeIdx) {
455 FLSrcLoc InsertedSrcLoc(Line, Column, ScopeIdx);
456 auto [SrcLocIt, Inserted] = SrcLocMap.try_emplace(InsertedSrcLoc);
457 if (Inserted)
458 SrcLocIt->second = FLContext->insertSrcLoc(InsertedSrcLoc);
459 return SrcLocIt->second;
460 }
461 // Returns the index for a SrcLoc with the given arguments, either returning
462 // the index of an existing copy or inserting a new entry and returning its
463 // index. May also insert \p Scope into the FunctionLocalContext.
465 const DILocalScope *Scope) {
466 FLIndex<FLScope> ScopeIdx = getScope(Scope);
467 return getSrcLoc(Line, Column, ScopeIdx);
468 }
469
471 const DISubprogram *SP);
472};
473
474} // end namespace llvm
475
476#endif // LLVM_IR_FUNCTIONLOCALMETADATA_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
uint64_t uint64_t
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define LLVM_ABI
Definition Compiler.h:211
This file defines the DenseMap class.
This file contains the declarations for metadata subclasses.
This file contains some templates that are useful if you are working with the STL at all.
This file defines the SmallVector class.
Value * RHS
Value * LHS
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
A scope for locals.
Subprogram description. Uses SubclassData1.
Small wrapper class for an FLMD index, which may be "no index".
FLIndex(std::nullopt_t)
bool operator!=(const FLIndex &Other) const
bool operator==(const FLIndex &Other) const
IndexType get() const
friend hash_code hash_value(const FLIndex< IndexedType > &Idx)
typename detail::HasFLIndex< IndexedType >::IndexType IndexType
static FLIndex fromRaw(IndexType RawIndex)
FLIndex(IndexType InIndex)
IndexType asRaw() const
FLIndex< FLSrcLoc > getSrcLoc(uint32_t Line, uint16_t Column, FLIndex< FLScope > ScopeIdx)
FLIndex< FLSrcLoc > getSrcLocWithScope(uint32_t Line, uint16_t Column, const DILocalScope *Scope)
FLIndex< FLScope > getScope(const DILocalScope *Scope)
LLVM_ABI FLMDBuilder(MDFunctionLocalContext *FLContext, const DISubprogram *SP)
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
Storage class for function-local metadata objects.
ArrayRef< FLInlinedCall > getInlinedCalls() const
FLSrcLoc getSrcLoc(FLIndex< FLSrcLoc > Idx) const
LLVM_ABI void getUsedMDNodes(SmallVectorImpl< const MDNode * > &Nodes) const
static bool classof(const Metadata *MD)
TempMDFunctionLocalContext clone() const
uint16_t getAtomGroupWaterline(FLIndex< FLInlinedCall > InlinedCallIdx)
FLIndex< FLSrcLoc > getOrInsertSrcLoc(FLSrcLoc SrcLoc)
Returns the existing index of SrcLoc, or else inserts it and returns its new index.
void setMaxAtomGroup(uint16_t NewAtomGroup)
Generally this shouldn't be called directly; prefer updateAtomGroupWaterline, including any relevant ...
FLInlinedCall getInlinedCall(FLIndex< FLInlinedCall > Idx) const
FLIndex< FLScope > getOrInsertScope(FLScope Scope)
Returns the existing index of Scope, or else inserts it and returns its new index.
LLVM_ABI void printShort(raw_ostream &OS, const Module *M=nullptr) const
Prints a shortened version of this FLContext, where only the number of entries in each storage array ...
TempMDFunctionLocalContext cloneImpl() const
FLIndex< FLInlinedCall > insertInlinedCall(FLInlinedCall InlinedCall, bool UniquableMayExist=true)
Returns the existing index of a uniquable InlinedCall, or else inserts it and returns its new index.
FLSrcLoc getSrcLoc(FLIndex< FLSrcLoc > Idx, FLIndex< FLInlinedCall > InlinedAt) const
FLIndex< FLSrcLoc > insertSrcLoc(FLSrcLoc SrcLoc)
Inserts a new FLSrcLoc SrcLoc and returns its index.
ArrayRef< FLScope > getScopes() const
void updateAtomGroupWaterline(FLIndex< FLInlinedCall > InlinedCallIdx, uint16_t NewWaterline)
ArrayRef< FLSrcLoc > getSrcLocs() const
FLScope getScope(FLIndex< FLScope > Idx, FLIndex< FLInlinedCall > InlinedAt) const
FLIndex< FLScope > insertScope(FLScope Scope)
Inserts a new FLScope Scope and returns its index.
FLScope getScope(FLIndex< FLScope > Idx) const
static LLVM_ABI MDFunctionLocalContext * getDistinct(LLVMContext &Context, bool NonDebug=false)
uint16_t getNewAtomGroup(FLIndex< FLInlinedCall > InlinedCallIdx)
static constexpr uint16_t MaxAllowedAtomGroup
Root of the metadata hierarchy.
Definition Metadata.h:65
StorageType
Active type of storage.
Definition Metadata.h:73
unsigned short SubclassData16
Definition Metadata.h:79
unsigned char Storage
Storage flag for non-uniqued, otherwise unowned, metadata.
Definition Metadata.h:76
unsigned getMetadataID() const
Definition Metadata.h:105
unsigned char SubclassData1
Definition Metadata.h:78
Manage lifetime of a slot tracker for printing IR.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An opaque object representing a hash code.
Definition Hashing.h:77
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
Definition ADL.h:123
This is an optimization pass for GlobalISel generic memory operations.
hash_code hash_value(const FixedPointSemantics &Val)
@ Other
Any other memory.
Definition ModRef.h:68
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
Definition Hashing.h:307
static bool isEqual(FLIndex< IndexedType > LHS, FLIndex< IndexedType > RHS)
static unsigned getHashValue(FLIndex< IndexedType > DL)
static unsigned getHashValue(FLInlinedCall IC)
static bool isEqual(FLInlinedCall LHS, FLInlinedCall RHS)
static unsigned getHashValue(FLScope Scope)
static bool isEqual(FLScope LHS, FLScope RHS)
static unsigned getHashValue(FLSrcLoc SrcLoc)
static bool isEqual(FLSrcLoc LHS, FLSrcLoc RHS)
An information struct used to provide DenseMap with the various necessary components for a given valu...
bool isInlined() const
Returns true if the location of this FLInlinedCall is inlined.
FLInlinedCall(FLIndex< FLSrcLoc > SrcLocIdx, FLIndex< FLInlinedCall > InlinedAtIdx, MDFunctionLocalContext *InlineeContext, bool Uniquable, uint16_t MaxAtomGroup=0)
FLIndex< FLInlinedCall > InlinedAtIdx
friend hash_code hash_value(const FLInlinedCall &IC)
MDFunctionLocalContext * getInlinee() const
MDFunctionLocalContext * InlineeContext
FLIndex< FLSrcLoc > SrcLocIdx
FLInlinedCall()=default
bool isEquivalent(const FLInlinedCall &Other) const
LLVM_ABI void print(raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const
FLInlinedCall getInlinedAt(const MDFunctionLocalContext *FLCtx) const
Returns the FLInlinedCall that this call was inlined at; only valid if isInlined().
LLVM_ABI void print(raw_ostream &OS, const Module *M=nullptr) const
static constexpr uint16_t MaxAllowedAtomGroup
Unique FLMD, just a wrapper around a DILocalScope.
LLVM_ABI void print(raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const
FLScope()=default
FLScope(DILocalScope *Scope)
friend hash_code hash_value(const FLScope &Scope)
const DILocalScope * get() const
LLVM_ABI void print(raw_ostream &OS, const Module *M=nullptr) const
DILocalScope * get()
bool operator==(const FLScope &Other) const
uint64_t asRawInt() const
friend hash_code hash_value(const FLSrcLoc &SrcLoc)
LLVM_ABI void print(raw_ostream &OS, const Module *M=nullptr) const
FLSrcLoc()=default
LLVM_ABI void print(raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const
bool operator==(const FLSrcLoc &Other) const
FLSrcLoc(uint32_t Line, uint16_t Column, FLIndex< FLScope > ScopeIdx)
FLIndex< FLScope > ScopeIdx