10#include "llvm/Config/llvm-config.h"
21 return cast_or_null<DILocation>(Loc.
get());
25 assert(
get() &&
"Expected valid DebugLoc");
26 return get()->getLine();
30 assert(
get() &&
"Expected valid DebugLoc");
31 return get()->getColumn();
35 assert(
get() &&
"Expected valid DebugLoc");
36 return get()->getScope();
40 assert(
get() &&
"Expected valid DebugLoc");
41 return get()->getInlinedAt();
45 return cast<DILocation>(Loc)->getInlinedAtScope();
59 return Loc->isImplicitCode();
66 Loc->setImplicitCode(ImplicitCode);
78 for (
DILocation *Loc = RootLoc; Loc; Loc = Loc->getInlinedAt()) {
79 if (
auto It = Cache.
find(Loc); It != Cache.
end()) {
80 CachedResult = cast<DILocation>(It->second);
92 *LocToUpdate->getScope(), NewSP, Ctx, Cache);
94 LocToUpdate->getColumn(), NewScope);
95 Cache[LocToUpdate] = UpdatedLoc;
103 LocToUpdate->getScope(), UpdatedLoc);
104 Cache[LocToUpdate] = UpdatedLoc;
118 while (
DILocation *IA = CurInlinedAt->getInlinedAt()) {
120 if (
auto *Found = Cache[IA]) {
121 Last = cast<DILocation>(Found);
134 Ctx, MD->getLine(), MD->getColumn(), MD->getScope(),
Last);
139#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
148 auto *Scope = cast<DIScope>(
getScope());
149 OS << Scope->getFilename();
156 InlinedAtDL.print(
OS);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static DILocalScope * cloneScopeForSubprogram(DILocalScope &RootScope, DISubprogram &NewSP, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode * > &Cache)
Traverses the scope chain rooted at RootScope until it hits a Subprogram, recreating the chain with "...
Base class for scope-like contexts.
void setImplicitCode(bool ImplicitCode)
DebugLoc getFnDebugLoc() const
Find the debug info location for the start of the function.
DILocation * get() const
Get the underlying DILocation.
MDNode * getScope() const
static DebugLoc appendInlinedAt(const DebugLoc &DL, DILocation *InlinedAt, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode * > &Cache)
Rebuild the entire inlined-at chain for this instruction so that the top of the chain now is inlined-...
void print(raw_ostream &OS) const
prints source location /path/to/file.exe:line:col @[inlined at]
static DebugLoc replaceInlinedAtSubprogram(const DebugLoc &DL, DISubprogram &NewSP, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode * > &Cache)
Rebuild the entire inline-at chain by replacing the subprogram at the end of the chain with NewSP.
bool isImplicitCode() const
Check if the DebugLoc corresponds to an implicit code.
DILocation * getInlinedAt() const
MDNode * getInlinedAtScope() const
Get the fully inlined-at scope for a DebugLoc.
iterator find(const_arg_type_t< KeyT > Val)
This is an important class for using LLVM in a threaded context.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
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.
auto reverse(ContainerTy &&C)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.