32 return llvm::make_error<SymbolRemappingParseError>(
38 Line = Line.
ltrim(
' ');
44 Line.
split(Parts,
' ', -1,
false);
46 if (Parts.
size() != 3)
47 return ReportError(
"Expected 'kind mangled_name mangled_name', " 48 "found '" + Line +
"'");
54 .
Case(
"encoding", FK::Encoding)
57 return ReportError(
"Invalid kind, expected 'name', 'type', or 'encoding'," 58 " found '" + Parts[0] +
"'");
61 switch (Canonicalizer.
addEquivalence(*FragmentKind, Parts[1], Parts[2])) {
65 case EE::ManglingAlreadyUsed:
66 return ReportError(
"Manglings '" + Parts[1] +
"' and '" + Parts[2] +
"' " 67 "have both been used in prior remappings. Move this " 68 "remapping earlier in the file.");
70 case EE::InvalidFirstMangling:
71 return ReportError(
"Could not demangle '" + Parts[1] +
"' " 72 "as a <" + Parts[0] +
">; invalid mangling?");
74 case EE::InvalidSecondMangling:
75 return ReportError(
"Could not demangle '" + Parts[2] +
"' " 76 "as a <" + Parts[0] +
">; invalid mangling?");
virtual StringRef getBufferIdentifier() const
Return an identifier for this buffer, typically the filename it was read from.
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
This class represents lattice values for constants.
A forward iterator which reads text lines from a buffer.
LLVM_NODISCARD StringRef ltrim(char Char) const
Return string with consecutive Char characters starting from the the left removed.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
bool is_at_eof() const
Return true if we've reached EOF or are an "end" iterator.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
int64_t line_number() const
Return the current line number. May return any number at EOF.
A switch()-like statement whose cases are string literals.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Error read(MemoryBuffer &B)
Read remappings from the given buffer, which must live as long as the remapper.
static ErrorSuccess success()
Create a success value.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
This interface provides simple read-only access to a block of memory, and provides simple methods for...
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
EquivalenceError addEquivalence(FragmentKind Kind, StringRef First, StringRef Second)
Add an equivalence between First and Second.
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
static void LLVM_ATTRIBUTE_NORETURN ReportError(uint32_t StartOffset, const char *ErrorMsg)