15#include "BitstreamRemarkParser.h"
28 while (!InBuffer.
empty()) {
30 std::pair<StringRef, StringRef> Split = InBuffer.
split(
'\0');
33 InBuffer = Split.second;
40 std::make_error_code(std::errc::invalid_argument),
41 "String with index %u is out of bounds (size = %u).", Index,
56 return DetectedFormat.takeError();
58 switch (*DetectedFormat) {
60 return std::make_unique<YAMLRemarkParser>(Buf);
62 return std::make_unique<BitstreamRemarkParser>(Buf);
73 std::optional<StringRef> ExternalFilePrependPath) {
76 return DetectedFormat.takeError();
78 switch (*DetectedFormat) {
83 std::move(ExternalFilePrependPath));
94 std::unique_ptr<RemarkParser> TheParser;
95 std::optional<std::string> Err;
101 bool hasError()
const {
return Err.has_value(); }
102 const char *getMessage()
const {
return Err ? Err->c_str() :
nullptr; };
123 CParser &TheCParser = *
unwrap(Parser);
135 TheCParser.handleError(std::move(E));
140 return wrap(MaybeRemark->release());
144 return unwrap(Parser)->hasError();
147extern "C" const char *
149 return unwrap(Parser)->getMessage();
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
Lightweight error class with error context and mandatory checking.
bool isA() const
Check whether one error is a subclass of another.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
StringRef - Represent a constant reference to a string, i.e.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
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.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
Attribute unwrap(LLVMAttributeRef Attr)
LLVMAttributeRef wrap(Attribute Attr)
const char * toString(DWARFSectionKind Kind)
void consumeError(Error Err)
Consume a Error without doing anything.