clang: lib/ExtractAPI/APIIgnoresList.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
17#include "llvm/ADT/STLExtras.h"
18#include "llvm/Support/Error.h"
19
20using namespace clang;
22using namespace llvm;
23
25
27 os << "Could not find API ignores file " << Path;
28}
29
31 return llvm::inconvertibleErrorCode();
32}
33
39
40 for (const auto &CurrentIgnoresFilePath : IgnoresFilePathList) {
41 auto BufferOrErr = FM.getBufferForFile(CurrentIgnoresFilePath);
42
43 if (!BufferOrErr)
44 return make_error(CurrentIgnoresFilePath);
45
46 auto Buffer = std::move(BufferOrErr.get());
47 Buffer->getBuffer().split(Lines, '\n', -1,
48 false);
49 symbolBufferList.push_back(std::move(Buffer));
50 }
51
52
53
54 transform(Lines, Lines.begin(), [](StringRef Line) { return Line.trim(); });
55 sort(Lines);
56 return APIIgnoresList(std::move(Lines), std::move(symbolBufferList));
57}
58
60 auto It = lower_bound(SymbolsToIgnore, SymbolName);
61 return (It != SymbolsToIgnore.end()) && (*It == SymbolName);
62}
Defines the clang::FileManager interface and associated types.
Implements support for file system lookup, file system caching, and directory search management.
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > getBufferForFile(FileEntryRef Entry, bool isVolatile=false, bool RequiresNullTerminator=true, std::optional< int64_t > MaybeLimit=std::nullopt, bool IsText=true)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.