Lines Matching refs:RD
53 bool VisitRecordDecl(const RecordDecl *RD) { in checkASTDecl()
54 Checker->visitRecord(RD); in checkASTDecl()
72 void visitRecord(const RecordDecl *RD, uint64_t PadMultiplier = 1) const { in visitRecord() argument
73 if (shouldSkipDecl(RD)) in visitRecord()
78 if (!(RD = RD->getDefinition())) in visitRecord()
85 if (auto *CXXRD = dyn_cast<CXXRecordDecl>(RD)) in visitRecord()
90 auto &ASTContext = RD->getASTContext(); in visitRecord()
91 const ASTRecordLayout &RL = ASTContext.getASTRecordLayout(RD); in visitRecord()
94 CharUnits BaselinePad = calculateBaselinePad(RD, ASTContext, RL); in visitRecord()
101 calculateOptimalPad(RD, ASTContext, RL); in visitRecord()
109 reportRecord(RD, BaselinePad, OptimalPad, OptimalFieldsOrder); in visitRecord()
131 bool shouldSkipDecl(const RecordDecl *RD) const { in shouldSkipDecl()
134 if (!(RD = RD->getDefinition())) in shouldSkipDecl()
136 auto Location = RD->getLocation(); in shouldSkipDecl()
148 if (RD->isUnion()) in shouldSkipDecl()
150 if (auto *CXXRD = dyn_cast<CXXRecordDecl>(RD)) { in shouldSkipDecl()
170 else if (RD->field_empty()) in shouldSkipDecl()
185 if (llvm::any_of(RD->fields(), IsTrickyField)) in shouldSkipDecl()
190 static CharUnits calculateBaselinePad(const RecordDecl *RD, in calculateBaselinePad() argument
195 for (const FieldDecl *FD : RD->fields()) { in calculateBaselinePad()
232 calculateOptimalPad(const RecordDecl *RD, const ASTContext &ASTContext, in calculateOptimalPad() argument
264 std::transform(RD->field_begin(), RD->field_end(), in calculateOptimalPad()
311 const RecordDecl *RD, CharUnits BaselinePad, CharUnits OptimalPad, in reportRecord() argument
316 Os << QualType::getAsString(RD->getTypeForDecl(), Qualifiers(), in reportRecord()
320 if (auto *TSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) { in reportRecord()
339 PathDiagnosticLocation::create(RD, BR->getSourceManager()); in reportRecord()
341 Report->setDeclWithIssue(RD); in reportRecord()
342 Report->addRange(RD->getSourceRange()); in reportRecord()