File indexing completed on 2026-05-10 08:36:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CLANG_API_IGNORES_LIST_H
0015 #define LLVM_CLANG_API_IGNORES_LIST_H
0016
0017 #include "clang/Basic/FileManager.h"
0018 #include "llvm/ADT/SmallVector.h"
0019 #include "llvm/ADT/StringRef.h"
0020 #include "llvm/Support/Error.h"
0021 #include "llvm/Support/raw_ostream.h"
0022
0023 #include <memory>
0024 #include <system_error>
0025
0026 namespace llvm {
0027 class MemoryBuffer;
0028 }
0029
0030 namespace clang {
0031 namespace extractapi {
0032
0033 struct IgnoresFileNotFound : public llvm::ErrorInfo<IgnoresFileNotFound> {
0034 std::string Path;
0035 static char ID;
0036
0037 explicit IgnoresFileNotFound(StringRef Path) : Path(Path) {}
0038
0039 virtual void log(llvm::raw_ostream &os) const override;
0040
0041 virtual std::error_code convertToErrorCode() const override;
0042 };
0043
0044
0045
0046 struct APIIgnoresList {
0047 using FilePathList = std::vector<std::string>;
0048
0049
0050
0051
0052 static llvm::Expected<APIIgnoresList>
0053 create(const FilePathList &IgnoresFilePathList, FileManager &FM);
0054
0055 APIIgnoresList() = default;
0056
0057
0058
0059 bool shouldIgnore(llvm::StringRef SymbolName) const;
0060
0061 private:
0062 using SymbolNameList = llvm::SmallVector<llvm::StringRef, 32>;
0063 using BufferList = llvm::SmallVector<std::unique_ptr<llvm::MemoryBuffer>>;
0064
0065 APIIgnoresList(SymbolNameList SymbolsToIgnore, BufferList Buffers)
0066 : SymbolsToIgnore(std::move(SymbolsToIgnore)),
0067 Buffers(std::move(Buffers)) {}
0068
0069 SymbolNameList SymbolsToIgnore;
0070 BufferList Buffers;
0071 };
0072
0073 }
0074 }
0075
0076 #endif