Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:28

0001 //===- ASTImportError.h - Define errors while importing AST -----*- 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 //
0009 //  This file defines the ASTImportError class which basically defines the kind
0010 //  of error while importing AST .
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_CLANG_AST_ASTIMPORTERROR_H
0015 #define LLVM_CLANG_AST_ASTIMPORTERROR_H
0016 
0017 #include "llvm/Support/Error.h"
0018 
0019 namespace clang {
0020 
0021 class ASTImportError : public llvm::ErrorInfo<ASTImportError> {
0022 public:
0023   /// \brief Kind of error when importing an AST component.
0024   enum ErrorKind {
0025     NameConflict,         /// Naming ambiguity (likely ODR violation).
0026     UnsupportedConstruct, /// Not supported node or case.
0027     Unknown               /// Other error.
0028   };
0029 
0030   ErrorKind Error;
0031 
0032   static char ID;
0033 
0034   ASTImportError() : Error(Unknown) {}
0035   ASTImportError(const ASTImportError &Other) : Error(Other.Error) {}
0036   ASTImportError &operator=(const ASTImportError &Other) {
0037     Error = Other.Error;
0038     return *this;
0039   }
0040   ASTImportError(ErrorKind Error) : Error(Error) {}
0041 
0042   std::string toString() const;
0043 
0044   void log(llvm::raw_ostream &OS) const override;
0045   std::error_code convertToErrorCode() const override;
0046 };
0047 
0048 } // namespace clang
0049 
0050 #endif // LLVM_CLANG_AST_ASTIMPORTERROR_H