mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
pull name slicing out of BuildInstructionOperandReference so
it doesn't do any lexical stuff anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118230 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ba3b5b6382
commit
5f4280cd2d
@ -500,8 +500,7 @@ private:
|
|||||||
ClassInfo *getTokenClass(StringRef Token);
|
ClassInfo *getTokenClass(StringRef Token);
|
||||||
|
|
||||||
/// getOperandClass - Lookup or create the class for the given operand.
|
/// getOperandClass - Lookup or create the class for the given operand.
|
||||||
ClassInfo *getOperandClass(StringRef Token,
|
ClassInfo *getOperandClass(const CGIOperandList::OperandInfo &OI);
|
||||||
const CGIOperandList::OperandInfo &OI);
|
|
||||||
|
|
||||||
/// BuildRegisterClasses - Build the ClassInfo* instances for register
|
/// BuildRegisterClasses - Build the ClassInfo* instances for register
|
||||||
/// classes.
|
/// classes.
|
||||||
@ -511,7 +510,7 @@ private:
|
|||||||
/// operand classes.
|
/// operand classes.
|
||||||
void BuildOperandClasses();
|
void BuildOperandClasses();
|
||||||
|
|
||||||
void BuildInstructionOperandReference(MatchableInfo *II,
|
void BuildInstructionOperandReference(MatchableInfo *II, StringRef OpName,
|
||||||
MatchableInfo::AsmOperand &Op);
|
MatchableInfo::AsmOperand &Op);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -778,8 +777,7 @@ ClassInfo *AsmMatcherInfo::getTokenClass(StringRef Token) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClassInfo *
|
ClassInfo *
|
||||||
AsmMatcherInfo::getOperandClass(StringRef Token,
|
AsmMatcherInfo::getOperandClass(const CGIOperandList::OperandInfo &OI) {
|
||||||
const CGIOperandList::OperandInfo &OI) {
|
|
||||||
if (OI.Rec->isSubClassOf("RegisterClass")) {
|
if (OI.Rec->isSubClassOf("RegisterClass")) {
|
||||||
if (ClassInfo *CI = RegisterClassClasses[OI.Rec])
|
if (ClassInfo *CI = RegisterClassClasses[OI.Rec])
|
||||||
return CI;
|
return CI;
|
||||||
@ -1102,8 +1100,14 @@ void AsmMatcherInfo::BuildInfo() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringRef OperandName;
|
||||||
|
if (Token[1] == '{')
|
||||||
|
OperandName = Token.substr(2, Token.size() - 3);
|
||||||
|
else
|
||||||
|
OperandName = Token.substr(1);
|
||||||
|
|
||||||
// Otherwise this is an operand reference.
|
// Otherwise this is an operand reference.
|
||||||
BuildInstructionOperandReference(II, Op);
|
BuildInstructionOperandReference(II, OperandName, Op);
|
||||||
}
|
}
|
||||||
|
|
||||||
II->BuildResultOperands();
|
II->BuildResultOperands();
|
||||||
@ -1117,16 +1121,8 @@ void AsmMatcherInfo::BuildInfo() {
|
|||||||
/// named operand such as $src. Resolve the Class and OperandInfo pointers.
|
/// named operand such as $src. Resolve the Class and OperandInfo pointers.
|
||||||
void AsmMatcherInfo::
|
void AsmMatcherInfo::
|
||||||
BuildInstructionOperandReference(MatchableInfo *II,
|
BuildInstructionOperandReference(MatchableInfo *II,
|
||||||
|
StringRef OperandName,
|
||||||
MatchableInfo::AsmOperand &Op) {
|
MatchableInfo::AsmOperand &Op) {
|
||||||
StringRef Token = Op.Token;
|
|
||||||
assert(Token[0] == '$' && "Not an operand name ref");
|
|
||||||
|
|
||||||
StringRef OperandName;
|
|
||||||
if (Token[1] == '{')
|
|
||||||
OperandName = Token.substr(2, Token.size() - 3);
|
|
||||||
else
|
|
||||||
OperandName = Token.substr(1);
|
|
||||||
|
|
||||||
const CGIOperandList &Operands = II->TheOperandList;
|
const CGIOperandList &Operands = II->TheOperandList;
|
||||||
|
|
||||||
|
|
||||||
@ -1137,7 +1133,7 @@ BuildInstructionOperandReference(MatchableInfo *II,
|
|||||||
OperandName.str() + "'");
|
OperandName.str() + "'");
|
||||||
|
|
||||||
// Set up the operand class.
|
// Set up the operand class.
|
||||||
Op.Class = getOperandClass(Token, Operands[Idx]);
|
Op.Class = getOperandClass(Operands[Idx]);
|
||||||
|
|
||||||
// If the named operand is tied, canonicalize it to the untied operand.
|
// If the named operand is tied, canonicalize it to the untied operand.
|
||||||
// For example, something like:
|
// For example, something like:
|
||||||
|
Loading…
Reference in New Issue
Block a user