Go to the documentation of this file.
15 #include "BitstreamRemarkParser.h"
26 while (!InBuffer.
empty()) {
28 std::pair<StringRef, StringRef> Split = InBuffer.
split(
'\0');
31 InBuffer = Split.second;
39 "String with index %u is out of bounds (size = %u).",
Index,
52 switch (ParserFormat) {
54 return std::make_unique<YAMLRemarkParser>(Buf);
58 "The YAML with string table format requires a parsed string table.");
60 return std::make_unique<BitstreamRemarkParser>(Buf);
63 "Unknown remark parser format.");
71 switch (ParserFormat) {
74 "The YAML format can't be used with a string "
75 "table. Use yaml-strtab instead.");
77 return std::make_unique<YAMLStrTabRemarkParser>(Buf,
std::move(StrTab));
79 return std::make_unique<BitstreamRemarkParser>(Buf,
std::move(StrTab));
82 "Unknown remark parser format.");
91 switch (ParserFormat) {
103 "Unknown remark parser format.");
111 std::unique_ptr<RemarkParser> TheParser;
121 bool hasError()
const {
return Err.has_value(); }
122 const char *getMessage()
const {
return Err ? Err->c_str() :
nullptr; };
132 StringRef(
static_cast<const char *
>(Buf), Size)));
138 StringRef(
static_cast<const char *
>(Buf), Size)));
143 CParser &TheCParser = *
unwrap(Parser);
160 return wrap(MaybeRemark->release());
164 return unwrap(Parser)->hasError();
167 extern "C" const char *
169 return unwrap(Parser)->getMessage();
This is an optimization pass for GlobalISel generic memory operations.
Tagged union holding either a T or a Error.
void consumeError(Error Err)
Consume a Error without doing anything.
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
(vector float) vec_cmpeq(*A, *B) C
Attribute unwrap(LLVMAttributeRef Attr)
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
LLVMAttributeRef wrap(Attribute Attr)
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
std::error_code make_error_code(BitcodeError E)
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
const char * toString(DWARFSectionKind Kind)
Lightweight error class with error context and mandatory checking.
Error takeError()
Take ownership of the stored error.
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).