clang  16.0.0git
ASTImportError.h
Go to the documentation of this file.
1 //===- ASTImportError.h - Define errors while importing AST -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the ASTImportError class which basically defines the kind
10 // of error while importing AST .
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_AST_ASTIMPORTERROR_H
15 #define LLVM_CLANG_AST_ASTIMPORTERROR_H
16 
17 #include "llvm/Support/Error.h"
18 
19 namespace clang {
20 
21 class ASTImportError : public llvm::ErrorInfo<ASTImportError> {
22 public:
23  /// \brief Kind of error when importing an AST component.
24  enum ErrorKind {
25  NameConflict, /// Naming ambiguity (likely ODR violation).
26  UnsupportedConstruct, /// Not supported node or case.
27  Unknown /// Other error.
28  };
29 
31 
32  static char ID;
33 
35  ASTImportError(const ASTImportError &Other) : Error(Other.Error) {}
37  Error = Other.Error;
38  return *this;
39  }
41 
42  std::string toString() const;
43 
44  void log(llvm::raw_ostream &OS) const override;
45  std::error_code convertToErrorCode() const override;
46 };
47 
48 } // namespace clang
49 
50 #endif // LLVM_CLANG_AST_ASTIMPORTERROR_H
clang::ASTImportError::convertToErrorCode
std::error_code convertToErrorCode() const override
Definition: ASTImporter.cpp:103
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::ASTImportError::operator=
ASTImportError & operator=(const ASTImportError &Other)
Definition: ASTImportError.h:36
clang::ASTImportError::ASTImportError
ASTImportError(const ASTImportError &Other)
Definition: ASTImportError.h:35
clang::ASTImportError::ASTImportError
ASTImportError()
Definition: ASTImportError.h:34
clang::ASTImportError::Unknown
@ Unknown
Not supported node or case.
Definition: ASTImportError.h:27
clang::ASTImportError::ASTImportError
ASTImportError(ErrorKind Error)
Definition: ASTImportError.h:40
clang::ASTImportError::ID
static char ID
Definition: ASTImportError.h:32
clang::ASTImportError::toString
std::string toString() const
Definition: ASTImporter.cpp:87
clang::ASTImportError::log
void log(llvm::raw_ostream &OS) const override
Definition: ASTImporter.cpp:101
clang::ASTImportError::NameConflict
@ NameConflict
Definition: ASTImportError.h:25
clang::ASTImportError::UnsupportedConstruct
@ UnsupportedConstruct
Naming ambiguity (likely ODR violation).
Definition: ASTImportError.h:26
clang::ASTImportError::Error
ErrorKind Error
Definition: ASTImportError.h:30
clang
Definition: CalledOnceCheck.h:17
clang::ASTImportError
Definition: ASTImportError.h:21
clang::ASTImportError::ErrorKind
ErrorKind
Kind of error when importing an AST component.
Definition: ASTImportError.h:24