LLVM: lib/ObjCopy/CommonConfig.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
11
12using namespace llvm;
14
18 switch (MS) {
20 return NameOrPattern(Pattern);
22 bool IsPositiveMatch = .consume_front("!");
24
25
26
27 if (!GlobOrErr) {
29 return std::move(E);
31 }
32
33 return NameOrPattern(std::make_shared(*GlobOrErr),
34 IsPositiveMatch);
35 }
38 std::string Err;
41 "cannot compile regular expression \'" +
44 return NameOrPattern(std::make_shared(
45 ("^" + Pattern.ltrim('^').rtrim('$') + "$").toStringRef(Data)));
46 }
47 }
49}
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
static LLVM_ABI Expected< GlobPattern > create(StringRef Pat, std::optional< size_t > MaxSubPatterns={})
LLVM_ABI bool isValid(std::string &Error) const
isValid - returns the error encountered during regex compilation, if any.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
static LLVM_ABI Expected< NameOrPattern > create(StringRef Pattern, MatchStyle MS, llvm::function_ref< Error(Error)> ErrorCallback)
Definition CommonConfig.cpp:16
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
FunctionAddr VTableAddr uintptr_t uintptr_t Data