@@ -694,22 +694,29 @@ class SectionAttr : public DeclAttribute {
694694// / Defines the @_cdecl attribute.
695695class CDeclAttr : public DeclAttribute {
696696public:
697- CDeclAttr (StringRef Name, SourceLoc AtLoc, SourceRange Range, bool Implicit)
698- : DeclAttribute(DeclAttrKind::CDecl, AtLoc, Range, Implicit), Name(Name) {
697+ CDeclAttr (StringRef Name, SourceLoc AtLoc, SourceRange Range, bool Implicit,
698+ bool Underscored)
699+ : DeclAttribute(DeclAttrKind::CDecl, AtLoc, Range, Implicit),
700+ Name (Name), Underscored(Underscored) {
699701 }
700702
701- CDeclAttr (StringRef Name, bool Implicit)
702- : CDeclAttr(Name, SourceLoc(), SourceRange(), Implicit) {}
703+ CDeclAttr (StringRef Name, bool Implicit, bool Underscored )
704+ : CDeclAttr(Name, SourceLoc(), SourceRange(), Implicit, Underscored ) {}
703705
704706 // / The symbol name.
705707 const StringRef Name;
706708
709+ // / Is this the version of the attribute that's underscored?
710+ // / Used to preserve retro compatibility with early adopters.
711+ const bool Underscored;
712+
707713 static bool classof (const DeclAttribute *DA) {
708714 return DA->getKind () == DeclAttrKind::CDecl;
709715 }
710716
711717 CDeclAttr *clone (ASTContext &ctx) const {
712- return new (ctx) CDeclAttr (Name, AtLoc, Range, isImplicit ());
718+ return new (ctx) CDeclAttr (Name, AtLoc, Range, isImplicit (),
719+ Underscored);
713720 }
714721
715722 bool isEquivalent (const CDeclAttr *other, Decl *attachedTo) const {
0 commit comments