@@ -694,22 +694,29 @@ class SectionAttr : public DeclAttribute {
694
694
// / Defines the @_cdecl attribute.
695
695
class CDeclAttr : public DeclAttribute {
696
696
public:
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) {
699
701
}
700
702
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 ) {}
703
705
704
706
// / The symbol name.
705
707
const StringRef Name;
706
708
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
+
707
713
static bool classof (const DeclAttribute *DA) {
708
714
return DA->getKind () == DeclAttrKind::CDecl;
709
715
}
710
716
711
717
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);
713
720
}
714
721
715
722
bool isEquivalent (const CDeclAttr *other, Decl *attachedTo) const {
0 commit comments