class SpecialCaseList {
public:
- // FIXME: Switch all users to factories and remove these constructors.
- SpecialCaseList(const StringRef Path);
- SpecialCaseList(const MemoryBuffer *MB);
-
/// Parses the special case list from a file. If Path is empty, returns
/// an empty special case list. On failure, returns 0 and writes an error
/// message to string.
SpecialCaseList::SpecialCaseList() : Entries() {}
-SpecialCaseList::SpecialCaseList(const StringRef Path) {
- // Validate and open blacklist file.
- if (Path.empty()) return;
- OwningPtr<MemoryBuffer> File;
- if (error_code EC = MemoryBuffer::getFile(Path, File)) {
- report_fatal_error("Can't open file '" + Path + "': " +
- EC.message());
- }
-
- std::string Error;
- if (!parse(File.get(), Error))
- report_fatal_error(Error);
-}
-
-SpecialCaseList::SpecialCaseList(const MemoryBuffer *MB) {
- std::string Error;
- if (!parse(MB, Error))
- report_fatal_error(Error);
-}
-
SpecialCaseList *SpecialCaseList::create(
const StringRef Path, std::string &Error) {
if (Path.empty())