Lines Matching refs:VD
31 DeclScope(ByteCodeExprGen<Emitter> *Ctx, const VarDecl *VD) in DeclScope() argument
32 : LocalScope<Emitter>(Ctx), Scope(Ctx->P, VD) {} in DeclScope()
267 if (auto *VD = dyn_cast<VarDecl>(DE->getDecl())) in dereference() local
268 return dereferenceVar(LV, *T, VD, AK, Direct, Indirect); in dereference()
325 const Expr *LV, PrimType T, const VarDecl *VD, DerefKind AK, in dereferenceVar() argument
328 auto It = Locals.find(VD); in dereferenceVar()
353 } else if (auto Idx = getGlobalIdx(VD)) { in dereferenceVar()
382 if (VD->hasLocalStorage() && VD->hasInit() && !VD->isConstexpr()) { in dereferenceVar()
383 QualType VT = VD->getType(); in dereferenceVar()
385 return this->Visit(VD->getInit()); in dereferenceVar()
429 if (auto *VD = dyn_cast_or_null<ValueDecl>(Src.dyn_cast<const Decl *>())) in allocateLocalPrimitive() local
430 Locals.insert({VD, Local}); in allocateLocalPrimitive()
442 if (auto *VD = dyn_cast_or_null<ValueDecl>(Src.dyn_cast<const Decl *>())) { in allocateLocal() local
443 Key = VD; in allocateLocal()
444 Ty = VD->getType(); in allocateLocal()
471 bool ByteCodeExprGen<Emitter>::getPtrVarDecl(const VarDecl *VD, const Expr *E) { in getPtrVarDecl() argument
473 if (Optional<unsigned> Idx = getGlobalIdx(VD)) { in getPtrVarDecl()
474 if (VD->getType()->isReferenceType()) in getPtrVarDecl()
479 return this->bail(VD); in getPtrVarDecl()
484 ByteCodeExprGen<Emitter>::getGlobalIdx(const VarDecl *VD) { in getGlobalIdx() argument
485 if (VD->isConstexpr()) { in getGlobalIdx()
487 return P.getGlobal(VD); in getGlobalIdx()
489 if (!VD->hasLocalStorage()) { in getGlobalIdx()
491 Program::DeclScope Scope(P, VD); in getGlobalIdx()
492 return P.getOrCreateGlobal(VD); in getGlobalIdx()
531 bool ByteCodeExprGen<Emitter>::visitDecl(const VarDecl *VD) { in visitDecl() argument
532 const Expr *Init = VD->getInit(); in visitDecl()
534 if (Optional<unsigned> I = P.createGlobal(VD)) { in visitDecl()
535 if (Optional<PrimType> T = classify(VD->getType())) { in visitDecl()
538 DeclScope<Emitter> LocalScope(this, VD); in visitDecl()
544 if (!this->emitDup(*T, VD)) in visitDecl()
546 if (!this->emitInitGlobal(*T, *I, VD)) in visitDecl()
548 return this->emitRet(*T, VD); in visitDecl()
552 DeclScope<Emitter> LocalScope(this, VD); in visitDecl()
558 if (!this->emitGetPtrGlobal(*I, VD)) in visitDecl()
560 return this->emitRetValue(VD); in visitDecl()
564 return this->bail(VD); in visitDecl()