Lines Matching refs:Ctx

20 MDNode *DebugLoc::getScope(const LLVMContext &Ctx) const {
26 assert(unsigned(ScopeIdx) <= Ctx.pImpl->ScopeRecords.size() &&
28 return Ctx.pImpl->ScopeRecords[ScopeIdx-1].get();
32 assert(unsigned(-ScopeIdx) <= Ctx.pImpl->ScopeInlinedAtRecords.size() &&
34 return Ctx.pImpl->ScopeInlinedAtRecords[-ScopeIdx-1].first.get();
37 MDNode *DebugLoc::getInlinedAt(const LLVMContext &Ctx) const {
43 assert(unsigned(-ScopeIdx) <= Ctx.pImpl->ScopeInlinedAtRecords.size() &&
45 return Ctx.pImpl->ScopeInlinedAtRecords[-ScopeIdx-1].second.get();
50 const LLVMContext &Ctx) const {
59 assert(unsigned(ScopeIdx) <= Ctx.pImpl->ScopeRecords.size() &&
61 Scope = Ctx.pImpl->ScopeRecords[ScopeIdx-1].get();
67 assert(unsigned(-ScopeIdx) <= Ctx.pImpl->ScopeInlinedAtRecords.size() &&
69 Scope = Ctx.pImpl->ScopeInlinedAtRecords[-ScopeIdx-1].first.get();
70 IA = Ctx.pImpl->ScopeInlinedAtRecords[-ScopeIdx-1].second.get();
73 MDNode *DebugLoc::getScopeNode(const LLVMContext &Ctx) const {
74 if (MDNode *InlinedAt = getInlinedAt(Ctx))
75 return DebugLoc::getFromDILocation(InlinedAt).getScopeNode(Ctx);
76 return getScope(Ctx);
79 DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) const {
80 const MDNode *Scope = getScopeNode(Ctx);
106 LLVMContext &Ctx = Scope->getContext();
110 Result.ScopeIdx = Ctx.pImpl->getOrAddScopeRecordIdxEntry(Scope, 0);
112 Result.ScopeIdx = Ctx.pImpl->getOrAddScopeInlinedAtIdxEntry(Scope,
120 MDNode *DebugLoc::getAsMDNode(const LLVMContext &Ctx) const {
124 getScopeAndInlinedAt(Scope, IA, Ctx);
154 void DebugLoc::dump(const LLVMContext &Ctx) const {
160 DebugLoc InlinedAtDL = DebugLoc::getFromDILocation(getInlinedAt(Ctx));
163 InlinedAtDL.dump(Ctx);
170 void DebugLoc::print(const LLVMContext &Ctx, raw_ostream &OS) const {
173 DIScope Scope(getScope(Ctx));
183 DebugLoc InlinedAtDL = DebugLoc::getFromDILocation(getInlinedAt(Ctx));
186 InlinedAtDL.print(Ctx, OS);
268 assert(Ctx->ScopeRecordIdx[Cur] == Idx && "Mapping out of date!");
269 Ctx->ScopeRecordIdx.erase(Cur);
278 assert(unsigned(-Idx-1) < Ctx->ScopeInlinedAtRecords.size());
279 std::pair<DebugRecVH, DebugRecVH> &Entry = Ctx->ScopeInlinedAtRecords[-Idx-1];
289 assert(Ctx->ScopeInlinedAtIdx[std::make_pair(OldScope, OldInlinedAt)] == Idx&&
291 Ctx->ScopeInlinedAtIdx.erase(std::make_pair(OldScope, OldInlinedAt));
317 assert(Ctx->ScopeRecordIdx[OldVal] == Idx && "Mapping out of date!");
318 Ctx->ScopeRecordIdx.erase(OldVal);
321 int NewEntry = Ctx->getOrAddScopeRecordIdxEntry(NewVal, Idx);
332 assert(unsigned(-Idx-1) < Ctx->ScopeInlinedAtRecords.size());
333 std::pair<DebugRecVH, DebugRecVH> &Entry = Ctx->ScopeInlinedAtRecords[-Idx-1];
343 assert(Ctx->ScopeInlinedAtIdx[std::make_pair(OldScope, OldInlinedAt)] == Idx&&
345 Ctx->ScopeInlinedAtIdx.erase(std::make_pair(OldScope, OldInlinedAt));
350 int NewIdx = Ctx->getOrAddScopeInlinedAtIdxEntry(Entry.first.get(),
355 std::pair<DebugRecVH, DebugRecVH> &Entry=Ctx->ScopeInlinedAtRecords[-Idx-1];