Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:05

0001 //===----- SemaSwift.h --- Swift language-specific routines ---*- C++ -*---===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 /// This file declares semantic analysis functions specific to Swift.
0010 ///
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_CLANG_SEMA_SEMASWIFT_H
0014 #define LLVM_CLANG_SEMA_SEMASWIFT_H
0015 
0016 #include "clang/AST/ASTFwd.h"
0017 #include "clang/Basic/LLVM.h"
0018 #include "clang/Basic/SourceLocation.h"
0019 #include "clang/Sema/SemaBase.h"
0020 
0021 namespace clang {
0022 class AttributeCommonInfo;
0023 class Decl;
0024 enum class ParameterABI;
0025 class ParsedAttr;
0026 class SwiftNameAttr;
0027 
0028 class SemaSwift : public SemaBase {
0029 public:
0030   SemaSwift(Sema &S);
0031 
0032   SwiftNameAttr *mergeNameAttr(Decl *D, const SwiftNameAttr &SNA,
0033                                StringRef Name);
0034 
0035   void handleAttrAttr(Decl *D, const ParsedAttr &AL);
0036   void handleAsyncAttr(Decl *D, const ParsedAttr &AL);
0037   void handleBridge(Decl *D, const ParsedAttr &AL);
0038   void handleError(Decl *D, const ParsedAttr &AL);
0039   void handleAsyncError(Decl *D, const ParsedAttr &AL);
0040   void handleName(Decl *D, const ParsedAttr &AL);
0041   void handleAsyncName(Decl *D, const ParsedAttr &AL);
0042   void handleNewType(Decl *D, const ParsedAttr &AL);
0043 
0044   /// Do a check to make sure \p Name looks like a legal argument for the
0045   /// swift_name attribute applied to decl \p D.  Raise a diagnostic if the name
0046   /// is invalid for the given declaration.
0047   ///
0048   /// \p AL is used to provide caret diagnostics in case of a malformed name.
0049   ///
0050   /// \returns true if the name is a valid swift name for \p D, false otherwise.
0051   bool DiagnoseName(Decl *D, StringRef Name, SourceLocation Loc,
0052                     const ParsedAttr &AL, bool IsAsync);
0053   void AddParameterABIAttr(Decl *D, const AttributeCommonInfo &CI,
0054                            ParameterABI abi);
0055 };
0056 
0057 } // namespace clang
0058 
0059 #endif // LLVM_CLANG_SEMA_SEMASWIFT_H