mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
Use Parse Mode
Augment the value parser to respect the parse mode and not error if an ID doesn't map to an object and we are in name parsing mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142520 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -677,11 +677,18 @@ Init *TGParser::ParseIDValue(Record *CurRec,
|
||||
}
|
||||
}
|
||||
|
||||
if (Mode == ParseNameMode)
|
||||
return StringInit::get(Name);
|
||||
|
||||
if (Record *D = Records.getDef(Name))
|
||||
return DefInit::get(D);
|
||||
|
||||
Error(NameLoc, "Variable not defined: '" + Name + "'");
|
||||
return 0;
|
||||
if (Mode == ParseValueMode) {
|
||||
Error(NameLoc, "Variable not defined: '" + Name + "'");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return StringInit::get(Name);
|
||||
}
|
||||
|
||||
/// ParseOperation - Parse an operator. This returns null on error.
|
||||
|
Reference in New Issue
Block a user