• Home
  • Raw
  • Download

Lines Matching refs:Old

1637 bool Sema::isIncompatibleTypedef(TypeDecl *Old, TypedefNameDecl *New) {  in isIncompatibleTypedef()  argument
1639 if (TypedefNameDecl *OldTypedef = dyn_cast<TypedefNameDecl>(Old)) in isIncompatibleTypedef()
1642 OldType = Context.getTypeDeclType(Old); in isIncompatibleTypedef()
1647 int Kind = isa<TypeAliasDecl>(Old) ? 1 : 0; in isIncompatibleTypedef()
1650 if (Old->getLocation().isValid()) in isIncompatibleTypedef()
1651 Diag(Old->getLocation(), diag::note_previous_definition); in isIncompatibleTypedef()
1660 int Kind = isa<TypeAliasDecl>(Old) ? 1 : 0; in isIncompatibleTypedef()
1663 if (Old->getLocation().isValid()) in isIncompatibleTypedef()
1664 Diag(Old->getLocation(), diag::note_previous_definition); in isIncompatibleTypedef()
1723 TypeDecl *Old = OldDecls.getAsSingle<TypeDecl>(); in MergeTypedefNameDecl() local
1724 if (!Old) { in MergeTypedefNameDecl()
1736 if (Old->isInvalidDecl()) in MergeTypedefNameDecl()
1741 if (isIncompatibleTypedef(Old, New)) in MergeTypedefNameDecl()
1746 if (TypedefNameDecl *Typedef = dyn_cast<TypedefNameDecl>(Old)) in MergeTypedefNameDecl()
1749 mergeDeclAttributes(New, Old); in MergeTypedefNameDecl()
1783 if (!isa<TypedefNameDecl>(Old)) in MergeTypedefNameDecl()
1788 Diag(Old->getLocation(), diag::note_previous_definition); in MergeTypedefNameDecl()
1801 (Context.getSourceManager().isInSystemHeader(Old->getLocation()) || in MergeTypedefNameDecl()
1807 Diag(Old->getLocation(), diag::note_previous_definition); in MergeTypedefNameDecl()
1871 static bool mergeAlignedAttrs(Sema &S, NamedDecl *New, Decl *Old) { in mergeAlignedAttrs() argument
1878 I = Old->specific_attr_begin<AlignedAttr>(), in mergeAlignedAttrs()
1879 E = Old->specific_attr_end<AlignedAttr>(); I != E; ++I) { in mergeAlignedAttrs()
2052 static void checkNewAttributesAfterDef(Sema &S, Decl *New, const Decl *Old) { in checkNewAttributesAfterDef() argument
2056 const Decl *Def = getDefinition(Old); in checkNewAttributesAfterDef()
2101 void Sema::mergeDeclAttributes(NamedDecl *New, Decl *Old, in mergeDeclAttributes() argument
2103 if (!Old->hasAttrs() && !New->hasAttrs()) in mergeDeclAttributes()
2107 checkNewAttributesAfterDef(*this, New, Old); in mergeDeclAttributes()
2109 if (!Old->hasAttrs()) in mergeDeclAttributes()
2119 i = Old->specific_attr_begin<InheritableAttr>(), in mergeDeclAttributes()
2120 e = Old->specific_attr_end<InheritableAttr>(); in mergeDeclAttributes()
2144 if (mergeAlignedAttrs(*this, New, Old)) in mergeDeclAttributes()
2256 static bool haveIncompatibleLanguageLinkages(const T *Old, const T *New) { in haveIncompatibleLanguageLinkages() argument
2257 const DeclContext *DC = Old->getDeclContext(); in haveIncompatibleLanguageLinkages()
2261 LanguageLinkage OldLinkage = Old->getLanguageLinkage(); in haveIncompatibleLanguageLinkages()
2282 FunctionDecl *Old = 0; in MergeFunctionDecl() local
2285 Old = OldFunctionTemplate->getTemplatedDecl(); in MergeFunctionDecl()
2287 Old = dyn_cast<FunctionDecl>(OldD); in MergeFunctionDecl()
2288 if (!Old) { in MergeFunctionDecl()
2314 if (Old->isInvalidDecl()) in MergeFunctionDecl()
2320 if (Old->isThisDeclarationADefinition()) in MergeFunctionDecl()
2322 else if (Old->isImplicit()) in MergeFunctionDecl()
2327 QualType OldQType = Context.getCanonicalType(Old->getType()); in MergeFunctionDecl()
2334 if (!isa<CXXMethodDecl>(New) && !isa<CXXMethodDecl>(Old) && in MergeFunctionDecl()
2336 Old->hasExternalFormalLinkage() && in MergeFunctionDecl()
2338 !canRedefineFunction(Old, getLangOpts())) { in MergeFunctionDecl()
2341 Diag(Old->getLocation(), PrevDiag); in MergeFunctionDecl()
2344 Diag(Old->getLocation(), PrevDiag); in MergeFunctionDecl()
2382 isABIDefaultCC(*this, NewTypeInfo.getCC(), Old)) { in MergeFunctionDecl()
2394 Diag(Old->getLocation(), diag::note_previous_declaration); in MergeFunctionDecl()
2411 Diag(Old->getLocation(), diag::note_previous_declaration); in MergeFunctionDecl()
2423 Diag(Old->getLocation(), diag::note_previous_declaration); in MergeFunctionDecl()
2439 if (!Old->isInlined() && New->isInlined() && in MergeFunctionDecl()
2442 Old->isUsed(false) && in MergeFunctionDecl()
2443 !Old->isDefined() && !New->isThisDeclarationADefinition()) in MergeFunctionDecl()
2444 UndefinedButUsed.insert(std::make_pair(Old->getCanonicalDecl(), in MergeFunctionDecl()
2450 Old->isInlined() && !Old->hasAttr<GNUInlineAttr>()) { in MergeFunctionDecl()
2451 UndefinedButUsed.erase(Old->getCanonicalDecl()); in MergeFunctionDecl()
2465 QualType OldDeclaredReturnType = (Old->getTypeSourceInfo() in MergeFunctionDecl()
2466 ? Old->getTypeSourceInfo()->getType()->castAs<FunctionType>() in MergeFunctionDecl()
2482 Diag(Old->getLocation(), PrevDiag) << Old << Old->getType(); in MergeFunctionDecl()
2494 AutoType *OldAT = Old->getResultType()->getContainedAutoType(); in MergeFunctionDecl()
2502 const CXXMethodDecl *OldMethod = dyn_cast<CXXMethodDecl>(Old); in MergeFunctionDecl()
2523 Diag(Old->getLocation(), PrevDiag) << Old << Old->getType(); in MergeFunctionDecl()
2547 Diag(Old->getLocation(), PrevDiag) << Old << Old->getType(); in MergeFunctionDecl()
2576 !Old->hasAttr<CXX11NoReturnAttr>()) { in MergeFunctionDecl()
2579 Diag(Old->getFirstDeclaration()->getLocation(), in MergeFunctionDecl()
2588 !Old->hasAttr<CarriesDependencyAttr>()) { in MergeFunctionDecl()
2591 Diag(Old->getFirstDeclaration()->getLocation(), in MergeFunctionDecl()
2610 if (haveIncompatibleLanguageLinkages(Old, New)) { in MergeFunctionDecl()
2612 Diag(Old->getLocation(), PrevDiag); in MergeFunctionDecl()
2617 return MergeCompatibleFunctionDecls(New, Old, S); in MergeFunctionDecl()
2662 return MergeCompatibleFunctionDecls(New, Old, S); in MergeFunctionDecl()
2677 Old->hasPrototype() && !New->hasPrototype() && in MergeFunctionDecl()
2679 Old->getNumParams() == New->getNumParams()) { in MergeFunctionDecl()
2683 = Old->getType()->getAs<FunctionProtoType>(); in MergeFunctionDecl()
2691 for (unsigned Idx = 0, End = Old->getNumParams(); in MergeFunctionDecl()
2693 ParmVarDecl *OldParm = Old->getParamDecl(Idx); in MergeFunctionDecl()
2722 return MergeCompatibleFunctionDecls(New, Old, S); in MergeFunctionDecl()
2734 if (Old->isImplicit() && (BuiltinID = Old->getBuiltinID())) { in MergeFunctionDecl()
2739 Diag(Old->getLocation(), diag::note_previous_builtin_declaration) in MergeFunctionDecl()
2740 << Old << Old->getType(); in MergeFunctionDecl()
2760 Diag(Old->getLocation(), PrevDiag) << Old << Old->getType(); in MergeFunctionDecl()
2773 bool Sema::MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old, in MergeCompatibleFunctionDecls() argument
2776 mergeDeclAttributes(New, Old); in MergeCompatibleFunctionDecls()
2779 if (Old->isPure()) in MergeCompatibleFunctionDecls()
2783 if (Old->isUsed(false)) in MergeCompatibleFunctionDecls()
2788 if (New->getNumParams() == Old->getNumParams()) in MergeCompatibleFunctionDecls()
2790 mergeParamDeclAttributes(New->getParamDecl(i), Old->getParamDecl(i), in MergeCompatibleFunctionDecls()
2794 return MergeCXXFunctionDecl(New, Old, S); in MergeCompatibleFunctionDecls()
2798 QualType Merged = Context.mergeTypes(Old->getType(), New->getType()); in MergeCompatibleFunctionDecls()
2833 void Sema::MergeVarDeclTypes(VarDecl *New, VarDecl *Old, bool OldWasHidden) { in MergeVarDeclTypes() argument
2834 if (New->isInvalidDecl() || Old->isInvalidDecl()) in MergeVarDeclTypes()
2842 } else if (Context.hasSameType(New->getType(), Old->getType())) { in MergeVarDeclTypes()
2844 return MergeVarDeclExceptionSpecs(New, Old); in MergeVarDeclTypes()
2851 else if (Old->getType()->isIncompleteArrayType() && in MergeVarDeclTypes()
2853 const ArrayType *OldArray = Context.getAsArrayType(Old->getType()); in MergeVarDeclTypes()
2858 } else if (Old->getType()->isArrayType() && in MergeVarDeclTypes()
2860 const ArrayType *OldArray = Context.getAsArrayType(Old->getType()); in MergeVarDeclTypes()
2864 MergedT = Old->getType(); in MergeVarDeclTypes()
2866 && Old->getType()->isObjCObjectPointerType()) { in MergeVarDeclTypes()
2868 Old->getType()); in MergeVarDeclTypes()
2871 MergedT = Context.mergeTypes(New->getType(), Old->getType()); in MergeVarDeclTypes()
2875 << New->getDeclName() << New->getType() << Old->getType(); in MergeVarDeclTypes()
2876 Diag(Old->getLocation(), diag::note_previous_definition); in MergeVarDeclTypes()
2901 VarDecl *Old = 0; in MergeVarDecl() local
2903 !(Old = dyn_cast<VarDecl>(Previous.getFoundDecl()))) { in MergeVarDecl()
2911 if (!shouldLinkPossiblyHiddenDecl(Old, New)) in MergeVarDecl()
2918 if (Old->isStaticDataMember() && !New->isOutOfLine()) { in MergeVarDecl()
2921 Diag(Old->getLocation(), diag::note_previous_declaration); in MergeVarDecl()
2925 mergeDeclAttributes(New, Old); in MergeVarDecl()
2929 Old->getStorageClass() == SC_None && in MergeVarDecl()
2930 !Old->getAttr<WeakImportAttr>()) { in MergeVarDecl()
2932 Diag(Old->getLocation(), diag::note_previous_definition); in MergeVarDecl()
2938 MergeVarDeclTypes(New, Old, PreviousWasHidden); in MergeVarDecl()
2945 Old->hasExternalFormalLinkage()) { in MergeVarDecl()
2947 Diag(Old->getLocation(), diag::note_previous_definition); in MergeVarDecl()
2959 if (New->hasExternalStorage() && Old->hasLinkage()) in MergeVarDecl()
2963 Old->getCanonicalDecl()->getStorageClass() == SC_Static) { in MergeVarDecl()
2965 Diag(Old->getLocation(), diag::note_previous_definition); in MergeVarDecl()
2971 !Old->hasLinkage() && Old->isLocalVarDecl()) { in MergeVarDecl()
2973 Diag(Old->getLocation(), diag::note_previous_definition); in MergeVarDecl()
2976 if (Old->hasLinkage() && New->isLocalVarDecl() && in MergeVarDecl()
2979 Diag(Old->getLocation(), diag::note_previous_definition); in MergeVarDecl()
2989 !(Old->getLexicalDeclContext()->isRecord() && in MergeVarDecl()
2992 Diag(Old->getLocation(), diag::note_previous_definition); in MergeVarDecl()
2996 if (New->getTLSKind() != Old->getTLSKind()) { in MergeVarDecl()
2997 if (!Old->getTLSKind()) { in MergeVarDecl()
2999 Diag(Old->getLocation(), diag::note_previous_declaration); in MergeVarDecl()
3002 Diag(Old->getLocation(), diag::note_previous_declaration); in MergeVarDecl()
3010 Diag(Old->getLocation(), diag::note_previous_declaration); in MergeVarDecl()
3018 (Def = Old->getDefinition())) { in MergeVarDecl()
3025 if (haveIncompatibleLanguageLinkages(Old, New)) { in MergeVarDecl()
3027 Diag(Old->getLocation(), diag::note_previous_definition); in MergeVarDecl()
3033 if (Old->isUsed(false)) in MergeVarDecl()
3037 New->setPreviousDeclaration(Old); in MergeVarDecl()
3040 New->setAccess(Old->getAccess()); in MergeVarDecl()
7928 if (VarDecl *Old = VDecl->getPreviousDecl()) in AddInitializerToDecl() local
7929 MergeVarDeclTypes(VDecl, Old, /*OldWasHidden*/ false); in AddInitializerToDecl()