@@ -2342,18 +2342,22 @@ class ExposeAttr : public DeclAttribute {
23422342// / Define the `@_extern` attribute, used to import external declarations in
23432343// / the specified way to interoperate with Swift.
23442344class ExternAttr : public DeclAttribute {
2345+ SourceLoc LParenLoc, RParenLoc;
2346+
23452347public:
2346- ExternAttr (llvm::Optional<StringRef> ModuleName, llvm::Optional<StringRef> Name,
2347- SourceLoc AtLoc, SourceRange Range, ExternKind Kind, bool Implicit)
2348- : DeclAttribute(DAK_Extern, AtLoc, Range, Implicit),
2349- ModuleName (ModuleName), Name(Name) {
2348+ ExternAttr (llvm::Optional<StringRef> ModuleName,
2349+ llvm::Optional<StringRef> Name, SourceLoc AtLoc,
2350+ SourceLoc LParenLoc, SourceLoc RParenLoc, SourceRange Range,
2351+ ExternKind Kind, bool Implicit)
2352+ : DeclAttribute(DAK_Extern, AtLoc, Range, Implicit), LParenLoc(LParenLoc),
2353+ RParenLoc (RParenLoc), ModuleName(ModuleName), Name(Name) {
23502354 Bits.ExternAttr .kind = static_cast <unsigned >(Kind);
23512355 }
23522356
2353- ExternAttr (llvm::Optional<StringRef> ModuleName, llvm::Optional<StringRef> Name,
2354- ExternKind Kind, bool Implicit)
2355- : ExternAttr(ModuleName, Name, SourceLoc(), SourceRange (), Kind ,
2356- Implicit) {}
2357+ ExternAttr (llvm::Optional<StringRef> ModuleName,
2358+ llvm::Optional<StringRef> Name, ExternKind Kind, bool Implicit)
2359+ : ExternAttr(ModuleName, Name, SourceLoc(), SourceLoc (), SourceLoc() ,
2360+ SourceRange(), Kind, Implicit) {}
23572361
23582362 // / The module name to import the named declaration in it
23592363 // / Used for Wasm import declaration.
@@ -2363,6 +2367,9 @@ class ExternAttr : public DeclAttribute {
23632367 // / std::nullopt if the declaration name is not specified with @_extern(c)
23642368 const llvm::Optional<StringRef> Name;
23652369
2370+ SourceLoc getLParenLoc () const { return LParenLoc; }
2371+ SourceLoc getRParenLoc () const { return RParenLoc; }
2372+
23662373 // / Returns the kind of extern.
23672374 ExternKind getExternKind () const {
23682375 return static_cast <ExternKind>(Bits.ExternAttr .kind );
0 commit comments