mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[YAMLIO] Add support for numeric values in enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226942 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -233,6 +233,13 @@ bool Input::matchEnumScalar(const char *Str, bool) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Input::matchEnumFallback() {
|
||||
if (ScalarMatchFound)
|
||||
return false;
|
||||
ScalarMatchFound = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Input::endEnumScalar() {
|
||||
if (!ScalarMatchFound) {
|
||||
setError(CurrentNode, "unknown enumerated scalar");
|
||||
@@ -508,6 +515,13 @@ bool Output::matchEnumScalar(const char *Str, bool Match) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Output::matchEnumFallback() {
|
||||
if (EnumerationMatchFound)
|
||||
return false;
|
||||
EnumerationMatchFound = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Output::endEnumScalar() {
|
||||
if (!EnumerationMatchFound)
|
||||
llvm_unreachable("bad runtime enum value");
|
||||
|
Reference in New Issue
Block a user