Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/IR/DebugLoc.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | DebugLoc DebugLoc::getFnDebugLoc() const { | ||||
// FIXME: Add a method on \a DILocation that does this work. | // FIXME: Add a method on \a DILocation that does this work. | ||||
const MDNode *Scope = getInlinedAtScope(); | const MDNode *Scope = getInlinedAtScope(); | ||||
if (auto *SP = getDISubprogram(Scope)) | if (auto *SP = getDISubprogram(Scope)) | ||||
return DebugLoc::get(SP->getScopeLine(), 0, SP); | return DebugLoc::get(SP->getScopeLine(), 0, SP); | ||||
return DebugLoc(); | return DebugLoc(); | ||||
} | } | ||||
bool DebugLoc::isImplicitCode() const { | |||||
if (DILocation *Loc = get()) { | |||||
return Loc->isImplicitCode(); | |||||
} | |||||
return true; | |||||
} | |||||
void DebugLoc::setImplicitCode(bool ImplicitCode) { | |||||
if (DILocation *Loc = get()) { | |||||
Loc->setImplicitCode(ImplicitCode); | |||||
} | |||||
} | |||||
DebugLoc DebugLoc::get(unsigned Line, unsigned Col, const MDNode *Scope, | DebugLoc DebugLoc::get(unsigned Line, unsigned Col, const MDNode *Scope, | ||||
const MDNode *InlinedAt) { | const MDNode *InlinedAt, bool ImplicitCode) { | ||||
// If no scope is available, this is an unknown location. | // If no scope is available, this is an unknown location. | ||||
if (!Scope) | if (!Scope) | ||||
return DebugLoc(); | return DebugLoc(); | ||||
return DILocation::get(Scope->getContext(), Line, Col, | return DILocation::get(Scope->getContext(), Line, Col, | ||||
const_cast<MDNode *>(Scope), | const_cast<MDNode *>(Scope), | ||||
const_cast<MDNode *>(InlinedAt)); | const_cast<MDNode *>(InlinedAt), ImplicitCode); | ||||
} | } | ||||
DebugLoc DebugLoc::appendInlinedAt(DebugLoc DL, DILocation *InlinedAt, | DebugLoc DebugLoc::appendInlinedAt(DebugLoc DL, DILocation *InlinedAt, | ||||
LLVMContext &Ctx, | LLVMContext &Ctx, | ||||
DenseMap<const MDNode *, MDNode *> &Cache, | DenseMap<const MDNode *, MDNode *> &Cache, | ||||
bool ReplaceLast) { | bool ReplaceLast) { | ||||
SmallVector<DILocation *, 3> InlinedAtLocations; | SmallVector<DILocation *, 3> InlinedAtLocations; | ||||
DILocation *Last = InlinedAt; | DILocation *Last = InlinedAt; | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |